Go to the source code of this file.
◆ DBGPRINT_BUFSIZE
◆ AsciiToUnicode() [1/2]
wstring AsciiToUnicode |
( |
const char * |
AsciiString | ) |
|
Converts an ASCII string to a Unicode one.
- Parameters
-
AsciiString | Constant pointer to a char array containing the ASCII string |
- Returns
- The Unicode string as std::wstring
Definition at line 220 of file tools.cpp.
221{
224 wstring ReturnString;
225
227
232
233 return ReturnString;
234}
#define MultiByteToWideChar
_In_ ULONG _In_ ULONG _In_ ULONG Length
Referenced by AddPrinterA(), AddPrintProcessorA(), AsciiToUnicode(), DeleteFormA(), DeletePrinterDriverExA(), DeletePrintProcessorA(), DeletePrintProvidorA(), EnumPrinterDriversA(), CWineTest::GetNextTestInfo(), ResetPrinterA(), SetJobA(), SetPrinterA(), and StartDocDlgA().
◆ AsciiToUnicode() [2/2]
Converts an ASCII string to a Unicode one.
- Parameters
-
AsciiString | Pointer to a std::string containing the ASCII string |
- Returns
- The Unicode string as std::wstring
Definition at line 246 of file tools.cpp.
247{
249}
const _CharT * c_str() const
◆ EscapeString() [1/2]
Escapes a string according to RFC 1738. Required for passing parameters to the web service.
- Parameters
-
Input | Constant pointer to a char array, which contains the input buffer to escape. |
- Returns
- The escaped string as std::string.
Definition at line 24 of file tools.cpp.
25{
26 string ReturnedString;
27
28 do
29 {
30 if(
strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~", *
Input))
31 {
32
33 ReturnedString += *
Input;
34 }
35 else
36 {
37
38 ReturnedString += '%';
41 }
42 }
44
45 return ReturnedString;
46}
char * strchr(const char *String, int ch)
Referenced by EscapeString(), CConfiguration::GetConfigurationFromFile(), and CWebService::Submit().
◆ EscapeString() [2/2]
Escapes a string according to RFC 1738. Required for passing parameters to the web service.
- Parameters
-
Input | Pointer to a std::string, which contains the input buffer to escape. |
- Returns
- The escaped string as std::string.
Definition at line 59 of file tools.cpp.
◆ GetINIValue()
Gets a value from a specified INI file and returns it converted to ASCII.
- Parameters
-
AppName | Constant pointer to a WCHAR array with the INI section to look in (lpAppName parameter passed to GetPrivateProfileStringW) |
KeyName | Constant pointer to a WCHAR array containing the key to look for in the specified section (lpKeyName parameter passed to GetPrivateProfileStringW) |
FileName | Constant pointer to a WCHAR array containing the path to the INI file |
- Returns
- Returns the data of the value as std::string or an empty string if no data could be retrieved.
Definition at line 187 of file tools.cpp.
188{
191 string ReturnedString;
193
194
196
198 {
199
200 AsciiBuffer =
new char[
Length + 1];
202
203 ReturnedString = AsciiBuffer;
204 delete[] AsciiBuffer;
205 }
206
207 return ReturnedString;
208}
static CHAR AppName[MAX_PATH]
#define WideCharToMultiByte
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Referenced by CConfiguration::GetConfigurationFromFile().
◆ IsNumber()
Determines whether a string contains entirely numeric values.
- Parameters
-
Input | Constant pointer to a char array containing the input to check. |
- Returns
- true if the string is entirely numeric, false otherwise.
Definition at line 74 of file tools.cpp.
75{
76 do
77 {
79 return false;
80
82 }
84
85 return true;
86}
Referenced by CWebService::GetSuiteID(), and CWebService::GetTestID().
◆ StringOut()
Outputs a string through the standard output and the debug output. The string may have LF or CRLF line endings.
- Parameters
-
String | The std::string to output |
Definition at line 96 of file tools.cpp.
97{
99 size_t i,
start = 0, last_newline = 0,
size = 0, curr_pos = 0;
100 string NewString;
101
102
104 {
105
107 {
108 NewString += '\n';
110 }
111 else
112 {
113
115 }
116
117 curr_pos = NewString.
size();
118
119
121 {
123 {
124
126 {
130 }
131 else
132 {
135 start = last_newline;
136 }
137
140 }
141
142 last_newline = curr_pos;
143 }
144 }
145
147
148
149 if(forcePrint == true || NewString[curr_pos - 1] == '\n')
150 {
151
154
158
160 return NewString;
161 }
162
163
166
167
169}
_Self substr(size_type __pos=0, size_type __n=npos) const
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
Referenced by CWineTest::GetNextTestInfo(), LdrpAllocateUnicodeString(), CJournaledTestList::LoadJournalFile(), CWineTest::Run(), CWineTest::RunTest(), ShutdownSystem(), wmain(), and CJournaledTestList::WriteInitialJournalFile().
◆ UnicodeToAscii() [1/2]
Converts a Unicode string to an ASCII one.
- Parameters
-
UnicodeString | Pointer to a std::wstring containing the Unicode string |
- Returns
- The ASCII string as std::string
Definition at line 287 of file tools.cpp.
◆ UnicodeToAscii() [2/2]
◆ HexCharacters
const char HexCharacters[] = "0123456789ABCDEF" |
|
static |