17 #ifdef DtUSE_UTILITIES_NAMESPACE
18 namespace DtUSE_UTILITIES_NAMESPACE
44 #define is_bigendian() ( (*(char*)&endianChecker) == 0 )
50 for(
int i = 0; i < ( theSize >> 1 ); ++i )
52 theEnd = ( theSize - 1 ) - i;
53 byteArray[ i ] ^= byteArray[ theEnd ];
54 byteArray[ theEnd ] ^= byteArray[ i ];
55 byteArray[ i ] ^= byteArray[ theEnd ];
62 unsigned short msbyte = rhs & 0x00ff;
63 unsigned short lsbyte = ( rhs & 0xff00 ) >> 8;
64 return ( msbyte << 8 ) | lsbyte;
72 return ( msword << 16 ) | lsword;
79 unsigned int mspart =
endianSwap32Bit( static_cast<unsigned int>(rhs & 0xffffffff) );
80 unsigned int lspart =
endianSwap32Bit(static_cast<unsigned int>(( rhs >> 32 ) & 0xffffffff) );
81 return (
DtU64 ( mspart ) << 32 ) | lspart;
112 bool usingDt =
false;
130 input = iter->second;
135 if(nonDt[0] ==
'D' && nonDt[1] ==
't')
150 std::string temp = input.
string();
158 input = temp.
c_str();
164 static const char *keywords[] = {
165 "abstract",
"as",
"base",
166 "break",
"case",
"catch",
167 "checked",
"class",
"const",
168 "continue",
"decimal",
"default",
"delegate",
169 "do",
"else",
"enum",
170 "event",
"explicit",
"extern",
"false",
171 "finally",
"fixed",
"for",
172 "foreach",
"goto",
"if",
"implicit",
173 "in",
"interface",
"internal",
174 "is",
"lock",
"namespace",
175 "new",
"null",
"object",
"operator",
176 "out",
"override",
"params",
"private",
177 "protected",
"public",
"readonly",
"ref",
179 "sizeof",
"stackalloc",
"static",
180 "struct",
"switch",
"this",
"throw",
181 "true",
"try",
"typeof",
182 "unchecked",
"unsafe",
183 "using",
"using static",
"virtual",
187 while (strlen(keywords[kw]) > 0)
189 if (strcmp(keywords[kw], input) == 0)
200 #ifdef DtUSE_UTILITIES_NAMESPACE
DtString DtReplaceAllSubstrings(const DtString &str, const DtString &searchFor, const DtString &replacement)
This function will replace all instances of a substring within a string with another string specified...
static std::map< DtString, DtString > longNamesToShortNames
Definition: vlCgHelpers.h:23
struct DtFloat64Layout::@7 bits
DtFloat32 flt
Definition: vlCgHelpers.h:36
const int endianChecker
This checks whether the machine is Big Endian or Little Endian.
Definition: vlCgHelpers.h:43
Contains the DtString class declaration.
static DtU16 endianSwap16Bit(DtU16 rhs)
swap 16 bits
Definition: vlCgHelpers.h:60
static DtFloat32 endianSwapFloat32Bit(DtFloat32 rhs)
swap 32 bits
Definition: vlCgHelpers.h:85
unsigned long long DtU64
-------—— Network Layout for a long long (64 bytes unsigned)
Definition: vlMachineTypes.h:185
static int myCurrentLargeFileNum
Definition: vlCgHelpers.h:22
static DtFloat64 endianSwapFloat64Bit(DtFloat64 rhs)
swap 64 bits
Definition: vlCgHelpers.h:98
DtU16 mslong
Definition: vlCgHelpers.h:38
static DtU64 endianSwap64Bit(DtU64 rhs)
swap 64 bits
Definition: vlCgHelpers.h:76
static DtString MakeCCompatibleString(DtString input)
Definition: vlCgHelpers.h:110
Used to Swap Longs.
Definition: vlCgHelpers.h:25
DtFloat64 flt
Definition: vlCgHelpers.h:27
DtU32 mslong
Definition: vlCgHelpers.h:29
static DtU32 endianSwap32Bit(DtU32 rhs)
swap 32 bits
Definition: vlCgHelpers.h:68
This file declares functions and types helpful to developers using DtString.
virtual void toUpper()
Convert this string's alphabetic characters to uppercase.
DtU16 lslong
Definition: vlCgHelpers.h:39
virtual const char * c_str() const
Returns a char* representation of the DtString;.
unsigned short DtU16
A 16 bit unsigned integer value.
Definition: vlMachineTypes.h:140
DtU32 lslong
Definition: vlCgHelpers.h:30
DtString DtFirstCharToUpper(const DtString &)
This function returns a new string with the first character uppercase.
Definition: vlCgHelpers.h:34
virtual int length() const
length() - Exactly the same as size():
virtual const char * string() const
string() - Returns a char * representation of the DtString: deprecated
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
virtual bool snipFront(const char ch, bool toLastCh=false)
Truncates everything before or after the character, including the character, respectively.
Instances of DtString are used to represent strings.
Definition: vlString.h:36
double DtFloat64
A 64 bit floating point value.
Definition: vlMachineTypes.h:212
struct DtFloat32Layout::@8 bits
static void swapByteArray(char *byteArray, int theSize)
Swap the byte array in memory.
Definition: vlCgHelpers.h:47