ReactOS 0.4.15-dev-7931-gfd331f1
fxstring.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxString.hpp
8
9Abstract:
10
11 This module implements a simple string class to operate on
12 unicode strings.
13
14Author:
15
16
17
18
19Environment:
20
21 Both kernel and user mode
22
23Revision History:
24
25
26--*/
27#ifndef _FXSTRING_H_
28#define _FXSTRING_H_
29
30class FxString : public FxObject {
31public:
32 //
33 // Length describes the length of the string in bytes (not WCHARs)
34 // MaximumLength describes the size of the buffer in bytes
35 //
37
38public:
40 __in PFX_DRIVER_GLOBALS FxDriverGlobals
41 );
42
43 ~FxString();
44
45 VOID
46 __inline
48 __out PUNICODE_STRING ReleaseTo
49 )
50 {
51 RtlCopyMemory(ReleaseTo, &m_UnicodeString, sizeof(UNICODE_STRING));
53 }
54
55 __inline
57 )
58 {
59 return &m_UnicodeString;
60 }
61
63 __inline
65 VOID
66 )
67 {
68 return &m_UnicodeString;
69 }
70
73 Assign(
75 );
76
79 Assign(
81 );
82
83 __inline
84 USHORT
86 VOID
87 )
88 {
90 }
91
92 __inline
93 USHORT
95 __in BOOLEAN IncludeNull
96 )
97 {
98 if (IncludeNull) {
99 return m_UnicodeString.Length + sizeof(UNICODE_NULL);
100 }
101 else {
102 return m_UnicodeString.Length;
103 }
104 }
105
106 __inline
107 USHORT
109 VOID
110 )
111 {
112 return m_UnicodeString.Length / sizeof(WCHAR);
113 }
114
115 __inline
116 USHORT
118 VOID
119 )
120 {
122 }
123
124 __inline
125 USHORT
127 VOID
128 )
129 {
131 }
132
133 __inline
134 USHORT
136 VOID
137 )
138 {
139 return m_UnicodeString.MaximumLength / sizeof(WCHAR);
140 }
141
142 __inline
143 PWCHAR
145 VOID
146 )
147 {
148 return m_UnicodeString.Buffer;
149 }
150};
151
152#endif // _FXSTRING_H_
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
__inline USHORT MaximumCharacterLength(VOID)
Definition: fxstring.hpp:135
PUNICODE_STRING __inline GetUnicodeString(VOID)
Definition: fxstring.hpp:64
VOID __inline ReleaseString(__out PUNICODE_STRING ReleaseTo)
Definition: fxstring.hpp:47
__inline USHORT MaximumLength(VOID)
Definition: fxstring.hpp:117
__inline USHORT MaximumByteLength(VOID)
Definition: fxstring.hpp:126
UNICODE_STRING m_UnicodeString
Definition: fxstring.hpp:36
__inline USHORT Length(VOID)
Definition: fxstring.hpp:85
__inline USHORT CharacterLength(VOID)
Definition: fxstring.hpp:108
__inline USHORT ByteLength(__in BOOLEAN IncludeNull)
Definition: fxstring.hpp:94
~FxString()
Definition: fxstring.cpp:37
__inline PWCHAR Buffer(VOID)
Definition: fxstring.hpp:144
_Must_inspect_result_ NTSTATUS Assign(__in PCWSTR SourceString)
Definition: fxstring.cpp:57
#define __in
Definition: dbghelp.h:35
#define __out
Definition: dbghelp.h:62
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
#define UNICODE_NULL
unsigned short USHORT
Definition: pedump.c:61
USHORT MaximumLength
Definition: env_spec_w32.h:370
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180