diff options
Diffstat (limited to 'include/m_system_cpp.h')
-rw-r--r-- | include/m_system_cpp.h | 62 |
1 files changed, 54 insertions, 8 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index be7c6ff84f..11ccbfc0b2 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -92,9 +92,8 @@ public: __inline explicit pass_ptrA(char *_p) : mir_ptr(_p) {}
__inline ~pass_ptrA() { zero(); }
__inline char* operator = (char *_p){ zero(); return mir_ptr::operator=(_p); }
- __inline void zero()
- {
- if (data) SecureZeroMemory(data, mir_strlen(data));
+ __inline void zero() {
+ if (data) SecureZeroMemory(data, mir_strlen(data));
}
};
@@ -105,14 +104,11 @@ public: __inline explicit pass_ptrW(wchar_t *_p) : mir_ptr(_p) {}
__inline ~pass_ptrW() { zero(); }
__inline wchar_t* operator = (wchar_t *_p){ zero(); return mir_ptr::operator=(_p); }
- __inline void zero()
- {
- if (data) SecureZeroMemory(data, mir_wstrlen(data)*sizeof(wchar_t));
+ __inline void zero() {
+ if (data) SecureZeroMemory(data, mir_wstrlen(data)*sizeof(wchar_t));
}
};
-typedef pass_ptrW pass_ptrT;
-
///////////////////////////////////////////////////////////////////////////////
// mir_cslockfull - controllable locker for the critical sections
@@ -319,6 +315,56 @@ public: void remove(size_t sz);
};
+///////////////////////////////////////////////////////////////////////////////
+// parameter classes for XML, JSON & HTTP requests
+
+struct PARAM
+{
+ const char *szName;
+ __forceinline PARAM(const char *_name) : szName(_name)
+ {}
+};
+
+struct BOOL_PARAM : public PARAM
+{
+ bool bValue;
+ __forceinline BOOL_PARAM(const char *_name, bool _value) :
+ PARAM(_name), bValue(_value)
+ {}
+};
+
+struct INT_PARAM : public PARAM
+{
+ int32_t iValue;
+ __forceinline INT_PARAM(const char *_name, int32_t _value) :
+ PARAM(_name), iValue(_value)
+ {}
+};
+
+struct INT64_PARAM : public PARAM
+{
+ int64_t iValue;
+ __forceinline INT64_PARAM(const char *_name, int64_t _value) :
+ PARAM(_name), iValue(_value)
+ {}
+};
+
+struct CHAR_PARAM : public PARAM
+{
+ const char *szValue;
+ __forceinline CHAR_PARAM(const char *_name, const char *_value) :
+ PARAM(_name), szValue(_value)
+ {}
+};
+
+struct WCHAR_PARAM : public PARAM
+{
+ const wchar_t *wszValue;
+ __forceinline WCHAR_PARAM(const char *_name, const wchar_t *_value) :
+ PARAM(_name), wszValue(_value)
+ {}
+};
+
#endif
#endif // M_SYSTEM_CPP_H
|