ReactOS  0.4.12-dev-14-gd0c8636
tmdump::schema_scan Class Reference
Inheritance diagram for tmdump::schema_scan:
Collaboration diagram for tmdump::schema_scan:

Public Member Functions

 schema_scan ()
 
void operator() (const struct TMPROPINFO &prop_)
 

Private Types

enum  { at_none, at_enum, at_parts, at_states }
 

Private Member Functions

bool has_suffix (const std::wstring &name_, const std::wstring &suffix_)
 

Private Attributes

enum tmdump::schema_scan:: { ... }  m_state
 
union {
   void *   p_none
 
   tm_enum_t *   p_enum
 
   tm_parts_t *   p_class
 
   tm_states_t *   p_states
 
m_cur
 

Detailed Description

Definition at line 157 of file themedump.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
at_none 
at_enum 
at_parts 
at_states 

Definition at line 160 of file themedump.cpp.

Constructor & Destructor Documentation

◆ schema_scan()

tmdump::schema_scan::schema_scan ( )
inline

Definition at line 191 of file themedump.cpp.

191 : m_state(at_none) { }
enum tmdump::schema_scan::@1531 m_state

Member Function Documentation

◆ has_suffix()

bool tmdump::schema_scan::has_suffix ( const std::wstring &  name_,
const std::wstring &  suffix_ 
)
inlineprivate

Definition at line 178 of file themedump.cpp.

179  {
180  if(name_.length() <= suffix_.length()) return false;
181 
182  return std::equal
183  (
184  name_.end() - suffix_.length(),
185  name_.end(),
186  suffix_.begin()
187  );
188  }
#define equal(x, y)
Definition: reader.cc:56

◆ operator()()

void tmdump::schema_scan::operator() ( const struct TMPROPINFO &  prop_)
inline

Definition at line 193 of file themedump.cpp.

194  {
195  static const std::wstring parts_suffix(L"PARTS");
196  static const std::wstring states_suffix(L"STATES");
197 
198  std::wstring name(prop_.pszName);
199 
200  // Compound declaration
201  if(prop_.sEnumVal == TMT_ENUMDEF && prop_.bPrimVal == TMT_ENUMDEF)
202  {
203  // class
204  if(has_suffix(name, parts_suffix))
205  {
206  m_state = at_parts;
207  m_cur.p_class = &
208  (
209  tm_classes
210  [
211  std::wstring(name.begin(), name.end() - parts_suffix.length())
212  ] = tm_parts_t()
213  );
214  }
215  // states
216  else if(has_suffix(name, states_suffix))
217  {
218  m_state = at_states;
219  m_cur.p_states = &
220  (
222  [
223  std::wstring(name.begin(), name.end() - states_suffix.length())
224  ] = tm_states_t()
225  );
226  }
227  // enumeration
228  else
229  {
230  m_state = at_enum;
231  m_cur.p_enum = &(tm_enums[name] = tm_enum_t());
232  }
233  }
234  // Enumeration member
235  else if(prop_.bPrimVal == TMT_ENUMVAL) switch(m_state)
236  {
237  // enumeration member
238  case at_enum:
239  {
240  (*m_cur.p_enum)[prop_.sEnumVal] = name;
241  break;
242  }
243 
244  // class part
245  case at_parts:
246  {
247  tm_part_t part;
248  part.name = name;
249  part.states = tm_state_enums.end();
250  (*m_cur.p_class)[prop_.sEnumVal] = part;
251  break;
252  }
253 
254  // state
255  case at_states:
256  {
257  (*m_cur.p_states)[prop_.sEnumVal] = name;
258  break;
259  }
260  }
261  // Primitive type
262  else if(prop_.sEnumVal == prop_.bPrimVal)
263  {
264  m_state = at_none;
265  m_cur.p_none = NULL;
266  }
267  // Property
268  else
269  {
270  m_state = at_none;
271  m_cur.p_none = NULL;
272 
273  tm_property_t property;
274 
275  property.name = name;
276  property.id = prop_.sEnumVal;
277  property.type = prop_.bPrimVal;
278 
279  if(prop_.bPrimVal == TMT_ENUM)
280  property.enum_type = tm_enums.find(name);
281 
282  tm_properties.push_back(property);
283  }
284  }
bool has_suffix(const std::wstring &name_, const std::wstring &suffix_)
Definition: themedump.cpp:178
std::map< int, tm_part_t > tm_parts_t
Definition: themedump.cpp:59
#define TMT_ENUM
Definition: themedump.cpp:26
union tmdump::schema_scan::@1532 m_cur
static tm_properties_t tm_properties
Definition: themedump.cpp:46
#define TMT_ENUMDEF
Definition: themedump.cpp:24
static tm_enums_t tm_enums
Definition: themedump.cpp:42
smooth NULL
Definition: ftsmooth.c:416
static tm_classes_t tm_classes
Definition: themedump.cpp:63
static const WCHAR L[]
Definition: oid.c:1087
std::map< int, std::wstring > tm_states_t
Definition: themedump.cpp:48
BSTR name
Definition: locator.c:109
#define TMT_ENUMVAL
Definition: themedump.cpp:25
Definition: name.c:36
enum tmdump::schema_scan::@1531 m_state
static tm_state_enums_t tm_state_enums
Definition: themedump.cpp:51
std::map< int, std::wstring > tm_enum_t
Definition: themedump.cpp:31
GLuint const GLchar * name
Definition: glext.h:6031

Member Data Documentation

◆ m_cur

union { ... } tmdump::schema_scan::m_cur

◆ m_state

enum { ... } tmdump::schema_scan::m_state

◆ p_class

tm_parts_t* tmdump::schema_scan::p_class

Definition at line 173 of file themedump.cpp.

◆ p_enum

tm_enum_t* tmdump::schema_scan::p_enum

Definition at line 172 of file themedump.cpp.

◆ p_none

void* tmdump::schema_scan::p_none

Definition at line 171 of file themedump.cpp.

◆ p_states

tm_states_t* tmdump::schema_scan::p_states

Definition at line 174 of file themedump.cpp.


The documentation for this class was generated from the following file: