BVB Source Codes

CRYENGINE Show XMLUtils.h Source code

Return Download CRYENGINE: download XMLUtils.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef _XMLUtils_h__
  4. #define _XMLUtils_h__
  5.  
  6. #pragma once
  7.  
  8. namespace XMLUtils
  9. {
  10. enum BoolType
  11. {
  12.         Invalid = -1,
  13.         False   = 0,
  14.         True    = 1,
  15. };
  16.  
  17. inline BoolType ToBoolType(const char* str)
  18. {
  19.         if (!stricmp(str, "1") || !stricmp(str, "true") || !stricmp(str, "yes"))
  20.                 return True;
  21.  
  22.         if (!stricmp(str, "0") || !stricmp(str, "false") || !stricmp(str, "no"))
  23.                 return False;
  24.  
  25.         return Invalid;
  26. }
  27.  
  28. inline BoolType GetBoolType(const XmlNodeRef& node, const char* attribute, const BoolType& deflt)
  29. {
  30.         if (node->haveAttr(attribute))
  31.         {
  32.                 const char* value;
  33.                 node->getAttr(attribute, &value);
  34.  
  35.                 return ToBoolType(value);
  36.         }
  37.  
  38.         return deflt;
  39. }
  40. }
  41.  
  42. #endif // XMLUtils
  43.  
downloadXMLUtils.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top