00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACE_ARGV_TYPE_CONVERTER_H
00014 #define ACE_ARGV_TYPE_CONVERTER_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "ace/ACE_export.h"
00019 #include "ace/OS_Memory.h"
00020
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif
00024
00025 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class ACE_Export ACE_Argv_Type_Converter
00040 {
00041 public:
00042
00043 ACE_Argv_Type_Converter (int &argc, char** argv);
00044
00045 #if defined (ACE_USES_WCHAR)
00046 ACE_Argv_Type_Converter (int &argc, wchar_t** argv);
00047 #endif // ACE_USES_WCHAR
00048
00049 ~ACE_Argv_Type_Converter (void);
00050
00051
00052 ACE_TCHAR** get_TCHAR_argv (void);
00053
00054
00055 char** get_ASCII_argv (void);
00056
00057
00058 int& get_argc (void);
00059
00060 private:
00061
00062
00063 ACE_Argv_Type_Converter (const ACE_Argv_Type_Converter&);
00064
00065
00066 ACE_Argv_Type_Converter operator= (const ACE_Argv_Type_Converter&);
00067
00068 #if defined (ACE_USES_WCHAR)
00069
00070
00071 void initialize (void);
00072
00073
00074
00075 void align_char_with_wchar (void);
00076
00077
00078
00079 void align_wchar_with_char (void);
00080
00081
00082 void cleanup (void);
00083 #endif // ACE_USES_WCHAR
00084
00085 private:
00086
00087 int &saved_argc_;
00088
00089
00090 char** char_argv_;
00091
00092 #if defined (ACE_USES_WCHAR)
00093
00094 wchar_t** wchar_argv_;
00095
00096
00097 int before_pass_argc_;
00098
00099
00100
00101 const int original_type_;
00102
00103
00104 int wchar_passed_;
00105
00106
00107 int char_passed_;
00108 #endif
00109 };
00110
00111 ACE_END_VERSIONED_NAMESPACE_DECL
00112
00113 #if defined (__ACE_INLINE__)
00114 #include "ace/Argv_Type_Converter.inl"
00115 #endif
00116
00117 #include "ace/post.h"
00118
00119 #endif