DCL 4.0
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 41 of file entitycopy/main.cpp.

42 : Arguments(
43 _output, _errout,
44 L"entitycopy 1.0",
45 L"daejung@gowoonsoft.com",
46 NULL,
47 L"Copy Database Tables",
48 __options__
49 )
50{
51 __dryrun = false;
52 __verbose = false;
53 __truncate = false;
54 __rows = -1;
55 __i4precision = 10;
56 __i8precision = 19;
57}
#define NULL
Definition Config.h:340

◆ 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 78 of file entitycopy/main.cpp.

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

◆ 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 112 of file entitycopy/main.cpp.

113{
114 if (__source.isEmpty() || __destination.isEmpty()) {
115 return L"option '--source' and '--destination' must both be provided";
116 }
117 return Arguments::onValidate();
118}
virtual String onValidate()
Definition Arguments.cpp:49

◆ 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 59 of file entitycopy/main.cpp.

60{
61 StringBuilder sb;
62 sb.append(value0())
63 .append(L" --verbose=").append(String::valueOf(__verbose))
64 .append(L" --source=").append(__source)
65 .append(L" --destination=").append(__destination)
66 .append(L" --entities=").append(__entities)
67 .append(L" --truncate=").append(String::valueOf(__truncate))
68 .append(L" --rows=").append(String::valueOf(__rows))
69 .append(L" --i4-precision=").append(String::valueOf(__i4precision))
70 .append(L" --i8-precision=").append(String::valueOf(__i8precision))
71 .append(L" --dry-run=").append(String::valueOf(__dryrun))
72 .append(L" values[").append(values().toString())
73 .append(L"]");
74
75 return sb;
76}
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: