MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrDynStrings.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef lgrDynStrings_H_
10 #define lgrDynStrings_H_
11 
12 #include <lgrSim/lgrSim.h>
13 #include <string>
14 
15 #if 0
16 
17 class DT_DLL_LGRSIM DtToCaseBuff
18 {
19 public:
21  DtToCaseBuff();
23  virtual ~DtToCaseBuff();
25  DtToCaseBuff( const DtToCaseBuff& src );
27  DtToCaseBuff& operator=( const DtToCaseBuff& src );
28 
29 public:
30  const char* tolower( const char* str );
31  const char* toupper( const char* str );
32  inline int len() const { return myLn; }
33 
34 protected:
35  int resize( int sz = 0 );
36 
37 protected:
38  char* myBuff;
39  int myLn, mySz;
40 };
41 
42 
43 class DT_DLL_LGRSIM DtWStringConv
44 {
45 public:
47  DtWStringConv();
49  virtual ~DtWStringConv();
51  DtWStringConv( const DtWStringConv& src );
53  DtWStringConv& operator=( const DtWStringConv& src );
54 
55 public:
57  bool operator==( const DtWStringConv& rhs ) const;
58  bool operator!=( const DtWStringConv& rhs ) const;
59 
60 public:
61  bool initFromCharArr( const char* str, int len = -1 );
62  bool initFromWString( const std::wstring& str );
63  void copyToWString( std::wstring& str );
64 
65 public:
66  inline const char* data() const;
67  inline int length() const;
68 
69 protected:
70  int resize( int sz = 0 );
71 
72 protected:
73  char* myBuff;
74  int myLn, mySz;
75 };
76 
77 
78 inline const char* DtWStringConv::data() const
79 {
80  return myBuff;
81 }
82 
83 
84 inline int DtWStringConv::length() const
85 {
86  return myLn;
87 }
88 
95 class DT_DLL_LGRSIM DtVarLengthBuffer
96 {
97 public:
99  DtVarLengthBuffer();
101  virtual ~DtVarLengthBuffer();
103  DtVarLengthBuffer( const DtVarLengthBuffer& src );
105  DtVarLengthBuffer& operator=( const DtVarLengthBuffer& src );
106 
107 public:
109  bool operator==( const DtVarLengthBuffer& rhs ) const;
110  bool operator!=( const DtVarLengthBuffer& rhs ) const;
111 
112 public:
117  bool init( const void* data, int dataSize, bool isString = false );
118 
119  bool setIsString( bool yesNo );
120  inline bool isString() const;
121 
122  bool setLength( int _length );
123  inline int length() const;
124 
125  inline const void* data() const;
126 
127  inline int bfSize() const;
128 
129 protected:
130  int resize( int sz = 0 );
131 
132 protected:
133  char* myBuff;
134  int myLn, mySz;
135  bool myIsString;
136 };
137 
138 
139 inline bool DtVarLengthBuffer::isString() const
140 {
141  return myIsString;
142 }
143 
144 
145 inline int DtVarLengthBuffer::length() const
146 {
147  return myLn;
148 }
149 
150 
151 inline const void* DtVarLengthBuffer::data() const
152 {
153  return myBuff;
154 }
155 
156 
157 inline int DtVarLengthBuffer::bfSize() const
158 {
159  return mySz;
160 }
161 
162 #endif
163 
170 {
171 public:
173  DtDynamicBuffer();
175  ~DtDynamicBuffer();
179  DtDynamicBuffer& operator=( const DtDynamicBuffer& );
180 
181  int resize( int sz = 0 );
182 
183 public:
184  char* myBuff;
185  int mySz;
186 };
187 
188 #endif

Document ID: Generated on Wed Jun 5 18:45:18 EDT 2019 from SVN revision 198968
Copyright © 2019 VT MAK. All Rights Reserved (www.mak.com)