ReactOS 0.4.16-dev-1946-g52006dd
xml2sdb.h File Reference
#include <string>
#include <list>
#include <vector>
#include <map>
#include <typedefs.h>
#include <guiddef.h>
#include <sdbtypes.h>
#include "sdbwrite.h"
#include <sdbtagid.h>
Include dependency graph for xml2sdb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  str_to_flag
 
struct  InExclude
 
struct  ShimRef
 
struct  FlagRef
 
struct  Shim
 
struct  Flag
 
struct  Data
 
struct  Layer
 
struct  MatchingFile
 
struct  Exe
 
struct  Library
 
struct  Database
 

Namespaces

namespace  tinyxml2
 

Typedefs

typedef std::basic_string< WCHARsdbstring
 

Enumerations

enum  PlatformType { PLATFORM_NONE = 0 , PLATFORM_X86 = 1 , PLATFORM_AMD64 = 4 , PLATFORM_ANY = PLATFORM_X86 | PLATFORM_AMD64 }
 

Functions

DWORD str_to_enum (const std::string &str, const str_to_flag *table)
 

Variables

str_to_flag platform_to_flag []
 

Typedef Documentation

◆ sdbstring

typedef std::basic_string<WCHAR> sdbstring

Definition at line 27 of file xml2sdb.h.

Enumeration Type Documentation

◆ PlatformType

Enumerator
PLATFORM_NONE 
PLATFORM_X86 
PLATFORM_AMD64 
PLATFORM_ANY 

Definition at line 31 of file xml2sdb.h.

32{
33 PLATFORM_NONE = 0,
34
35 // This is all we support for now
36 PLATFORM_X86 = 1,
37 // There is another platform here, but we don't support it yet
38 // https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/kshim/drvmain.htm
40
42};
@ PLATFORM_NONE
Definition: xml2sdb.h:33
@ PLATFORM_ANY
Definition: xml2sdb.h:41
@ PLATFORM_X86
Definition: xml2sdb.h:36
@ PLATFORM_AMD64
Definition: xml2sdb.h:39

Function Documentation

◆ str_to_enum()

DWORD str_to_enum ( const std::string &  str,
const str_to_flag table 
)

Definition at line 51 of file xml2sdb.cpp.

52{
53 DWORD value = 0;
54 std::istringstream iss(str);
55 std::string item;
56 while (std::getline(iss, item, ','))
57 {
58 std::string trimmedItem = item;
59 trimmedItem.erase(remove_if(trimmedItem.begin(), trimmedItem.end(), isspace), trimmedItem.end());
60 std::transform(trimmedItem.begin(), trimmedItem.end(), trimmedItem.begin(), ::toupper);
61 for (const str_to_flag* p = table; p->name; ++p)
62 {
63 if (trimmedItem == p->name)
64 {
65 value |= p->flag;
66 break;
67 }
68 }
69 }
70 return value;
71}
_STLP_INLINE_LOOP _ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
Definition: _algo.h:278
#define isspace(c)
Definition: acclib.h:69
int toupper(int c)
Definition: utclib.c:881
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
const WCHAR * str
const WCHAR * name
Definition: pdh_main.c:96

Referenced by parse_platform(), and ReadPlatformNode().

Variable Documentation

◆ platform_to_flag

str_to_flag platform_to_flag[]
extern

Definition at line 42 of file xml2sdb.cpp.

Referenced by parse_platform(), and ReadPlatformNode().