DCL 3.7.4
Loading...
Searching...
No Matches
MainArguments Class Reference

#include <main.h>

Inheritance diagram for MainArguments:
Arguments Arguments Object Object

Public Member Functions

 MainArguments (Writer &_output, Writer &_errout)
virtual String toString () const
bool verbose () const
const String & source () const
const String & destination () const
const String & entities () const
bool truncate () const
int rows () const
int i4precision () const
int i8precision () const
bool dryrun () const
 MainArguments (Writer &_output, Writer &_errout)
virtual String toString () const
bool dryrun () const
bool summary () const
bool verbose () const
const String & database () const
Public Member Functions inherited from Arguments
String help () const
String shortUsage () const
String tryUsage () const
String argRequired (const String &_option) const
String usage () const
String version () const
Public Member Functions inherited from Object
virtual void destroy ()
String className () const
bool isInstanceOf (const std::type_info &typeinfo) const
virtual const std::type_info & typeInfo () const

Protected Member Functions

virtual void onOption (int _key, const String &_arg) __DCL_THROWS1(Exception *)
virtual String onValidate ()
virtual void onOption (int _key, const String &_arg) __DCL_THROWS1(Exception *)
virtual String onValidate ()
Protected Member Functions inherited from Object
virtual ~Object ()
 Object ()

Protected Attributes

bool __dryrun
bool __verbose
String __source
String __destination
String __entities
bool __truncate
int __rows
int __i4precision
int __i8precision
bool __summary
String __database

Detailed Description

Definition at line 10 of file entitycopy/main.h.

Constructor & Destructor Documentation

◆ MainArguments() [1/2]

MainArguments::MainArguments ( Writer & _output,
Writer & _errout )

Definition at line 49 of file work/entitycopy/main.cpp.

50 : Arguments(
51 _output, _errout,
52 L"entitycopy " DCL_ENTITY_COPY_VERSION_STRING,
53 L"daejung@gowoonsoft.com, gowoonsoft.com@gmail.com",
54 NULL,
55 L"Copy Database Tables",
56 __options__
57 )
58{
59 __dryrun = false;
60 __verbose = false;
61 __truncate = false;
62 __rows = -1;
63 __i4precision = 10;
64 __i8precision = 19;
65}
#define NULL
Definition Config.h:312
#define DCL_ENTITY_COPY_VERSION_STRING

◆ MainArguments() [2/2]

MainArguments::MainArguments ( Writer & _output,
Writer & _errout )

Member Function Documentation

◆ database()

const String & MainArguments::database ( ) const
inline

Definition at line 29 of file mediatag/main.h.

29 {
30 return __database;
31 }

◆ destination()

const String & MainArguments::destination ( ) const
inline

Definition at line 25 of file entitycopy/main.h.

25 {
26 return __destination;
27 }

◆ dryrun() [1/2]

bool MainArguments::dryrun ( ) const
inline

Definition at line 49 of file entitycopy/main.h.

49 {
50 return __dryrun;
51 }

◆ dryrun() [2/2]

bool MainArguments::dryrun ( ) const
inline

Definition at line 17 of file mediatag/main.h.

17 {
18 return __dryrun;
19 }

◆ entities()

const String & MainArguments::entities ( ) const
inline

Definition at line 29 of file entitycopy/main.h.

29 {
30 return __entities;
31 }

◆ i4precision()

int MainArguments::i4precision ( ) const
inline

Definition at line 41 of file entitycopy/main.h.

41 {
42 return __i4precision;
43 }

◆ i8precision()

int MainArguments::i8precision ( ) const
inline

Definition at line 45 of file entitycopy/main.h.

45 {
46 return __i8precision;
47 }

◆ onOption() [1/2]

void MainArguments::onOption ( int _key,
const String & _arg )
protectedvirtual

Reimplemented from Arguments.

Definition at line 86 of file work/entitycopy/main.cpp.

88{
89 switch (_key) {
90 case L'v':
91 __verbose = true;
92 break;
93 case L's':
94 __source = _arg;
95 break;
96 case L'd':
97 __destination = _arg;
98 break;
99 case L'e':
100 __entities = _arg;
101 break;
102 case L'c':
103 __truncate = true;
104 break;
105 case L'r':
106 __rows = Int32::parse(_arg.data());
107 break;
108 case L'4':
109 __i4precision = Int32::parse(_arg.data(), 10, __i4precision);
110 break;
111 case L'8':
112 __i8precision = Int32::parse(_arg.data(), 10, __i8precision);
113 break;
114 case L'n':
115 __dryrun = true;
116 break;
117 }
118}
static int32_t parse(const wchar_t *_number, unsigned _base=10) __DCL_THROWS1(NumericConvertException *)
Definition Numeric.cpp:264

◆ onOption() [2/2]

virtual void MainArguments::onOption ( int _key,
const String & _arg )
protectedvirtual

Reimplemented from Arguments.

◆ onValidate() [1/2]

String MainArguments::onValidate ( )
protectedvirtual

Reimplemented from Arguments.

Definition at line 120 of file work/entitycopy/main.cpp.

121{
122 if (__source.isEmpty() || __destination.isEmpty()) {
123 return L"option '--source' and '--destination' must both be provided";
124 }
125 return Arguments::onValidate();
126}
virtual String onValidate()
Definition Arguments.cpp:48

◆ onValidate() [2/2]

virtual String MainArguments::onValidate ( )
protectedvirtual

Reimplemented from Arguments.

◆ rows()

int MainArguments::rows ( ) const
inline

Definition at line 37 of file entitycopy/main.h.

37 {
38 return __rows;
39 }

◆ source()

const String & MainArguments::source ( ) const
inline

Definition at line 21 of file entitycopy/main.h.

21 {
22 return __source;
23 }

◆ summary()

bool MainArguments::summary ( ) const
inline

Definition at line 21 of file mediatag/main.h.

21 {
22 return __summary;
23 }

◆ toString() [1/2]

String MainArguments::toString ( ) const
virtual

Reimplemented from Object.

Definition at line 67 of file work/entitycopy/main.cpp.

68{
69 StringBuilder sb;
70 sb.append(value0())
71 .append(L" --verbose=").append(String::valueOf(__verbose))
72 .append(L" --source=").append(__source)
73 .append(L" --destination=").append(__destination)
74 .append(L" --entities=").append(__entities)
75 .append(L" --truncate=").append(String::valueOf(__truncate))
76 .append(L" --rows=").append(String::valueOf(__rows))
77 .append(L" --i4-precision=").append(String::valueOf(__i4precision))
78 .append(L" --i8-precision=").append(String::valueOf(__i8precision))
79 .append(L" --dry-run=").append(String::valueOf(__dryrun))
80 .append(L" values[").append(values().toString())
81 .append(L"]");
82
83 return sb;
84}
virtual String toString() const

◆ toString() [2/2]

virtual String MainArguments::toString ( ) const
virtual

Reimplemented from Object.

◆ truncate()

bool MainArguments::truncate ( ) const
inline

Definition at line 33 of file entitycopy/main.h.

33 {
34 return __truncate;
35 }

◆ verbose() [1/2]

bool MainArguments::verbose ( ) const
inline

Definition at line 17 of file entitycopy/main.h.

17 {
18 return __verbose;
19 }

◆ verbose() [2/2]

bool MainArguments::verbose ( ) const
inline

Definition at line 25 of file mediatag/main.h.

25 {
26 return __verbose;
27 }

Member Data Documentation

◆ __database

String MainArguments::__database
protected

Definition at line 42 of file mediatag/main.h.

◆ __destination

String MainArguments::__destination
protected

Definition at line 62 of file entitycopy/main.h.

◆ __dryrun

bool MainArguments::__dryrun
protected

Definition at line 59 of file entitycopy/main.h.

◆ __entities

String MainArguments::__entities
protected

Definition at line 63 of file entitycopy/main.h.

◆ __i4precision

int MainArguments::__i4precision
protected

Definition at line 66 of file entitycopy/main.h.

◆ __i8precision

int MainArguments::__i8precision
protected

Definition at line 67 of file entitycopy/main.h.

◆ __rows

int MainArguments::__rows
protected

Definition at line 65 of file entitycopy/main.h.

◆ __source

String MainArguments::__source
protected

Definition at line 61 of file entitycopy/main.h.

◆ __summary

bool MainArguments::__summary
protected

Definition at line 40 of file mediatag/main.h.

◆ __truncate

bool MainArguments::__truncate
protected

Definition at line 64 of file entitycopy/main.h.

◆ __verbose

bool MainArguments::__verbose
protected

Definition at line 60 of file entitycopy/main.h.


The documentation for this class was generated from the following files: