#include <dcl/Config.h>
#include <locale.h>
#include <dcl/FileWriter.h>
#include <dcl/Arguments.h>
#include <dcl/DateTime.h>
#include "main.h"
#include "EntityCopy.h"
Go to the source code of this file.
|
void | __main (const MainArguments &_args) |
__DCL_END_NAMESPACE __DCL_USING_NAMESPACE int | main (int _argc, char *_argv[]) |
◆ __main()
Definition at line 120 of file entitycopy/main.cpp.
121{
122 String srcDriver;
123 String dstDriver;
124 {
125 String s = _args.
source().substring(L
"DRIVER *= *[^ ;]+",
true);
126 if (!s.isEmpty()) {
127 srcDriver = s.substring(s.indexOf(L'=') + 1).trim();
128 }
129 s = _args.
destination().substring(L
"DRIVER *= *[^ ;]+",
true);
130 if (!s.isEmpty()) {
131 dstDriver = s.substring(s.indexOf(L'=') + 1).trim();
132 }
133 }
134
135 if (srcDriver.isEmpty() || dstDriver.isEmpty()) {
136 _args.errout() << _args.value0() << L": option '--source' or '--destination' is invalid"
138 return;
139 }
140
142 if (copy.initialize()) {
143 copy.doIt();
144 }
145}
const String & destination() const
const String & source() const
◆ main()
__DCL_END_NAMESPACE __DCL_USING_NAMESPACE int main |
( |
int | _argc, |
|
|
char * | _argv[] ) |
Definition at line 151 of file entitycopy/main.cpp.
152{
153
154 setlocale(LC_ALL, "");
155
157 {
160#if __DCL_DEBUG
161 DCLDebugSetGlobalReport(&errout);
162#endif
164 if (args.parse(_argc, _argv, false)) {
165 String sep(L'=', 80);
167 output << L
"Start [" << start.
toString()
169 if (args.verbose()) {
170 output << L
" [" << args.toString() << L
"]" <<
endl;
171 }
172 output << sep <<
endl;
173
174 try {
176 }
180 }
181
183 output << sep <<
endl
185 << L" " << (finish - start).toString()
187 }
188#if __DCL_DEBUG
189#if __DCL_HAVE_ALLOC_DEBUG
190 DCLDebugDumpGlobalMemoryLeak(DCL_ALLOC_DUMP_ALL, &errout);
191#endif
192 DCLDebugSetGlobalReport(
NULL);
193#endif
194 }
196
197 return 0;
198}
static DateTime getCurrentLocalTime()
String toStringAll() const
void __main(const MainArguments &_args)