diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-11-01 14:28:18 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-11-01 14:28:18 +0000 |
commit | 31d3a6408d045eadaff094d4c11bf017817743d7 (patch) | |
tree | 61f75240490677d57477fea63d6f771bf3d754d9 /attache/FieldInfo.h | |
parent | 31654bd814b4e5fdc1b68807e341c623d74f357d (diff) |
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@4 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'attache/FieldInfo.h')
-rw-r--r-- | attache/FieldInfo.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/attache/FieldInfo.h b/attache/FieldInfo.h new file mode 100644 index 0000000..9d1f661 --- /dev/null +++ b/attache/FieldInfo.h @@ -0,0 +1,58 @@ +#pragma once
+
+#include "common.h"
+
+class FieldInfo
+{
+ TCHAR m_fieldName[512];
+ TCHAR m_fieldValue[2048];
+
+public:
+ FieldInfo(TCHAR *lpszFieldName, TCHAR *lpszFieldValue) {
+ _tcsncpy(m_fieldName, lpszFieldName, 512);
+ _tcsncpy(m_fieldValue, lpszFieldValue, 2048);
+ }
+
+ FieldInfo() {}
+ FieldInfo(const FieldInfo &other) {
+ memcpy(this, &other, sizeof(FieldInfo));
+ }
+
+ const TCHAR *GetFieldName() const { return &m_fieldName[0]; }
+ const TCHAR *GetFieldValue() const { return &m_fieldValue[0]; }
+};
+
+//typedef std::vector< FieldInfo > FieldInfoCollection;
+class FieldInfoList {
+public:
+ class ListNode {
+ public:
+ ListNode() {}
+ FieldInfo info;
+ ListNode *next;
+ };
+
+ FieldInfoList(): head(0) {}
+ ~FieldInfoList() {clear();}
+
+ void clear() {
+ ListNode *n = head;
+ while(n) {
+ n = n->next;
+ delete head;
+ head = n;
+ }
+ }
+
+ void push_back(const FieldInfo &info) {
+ ListNode *n = new ListNode;
+ n->info = info;
+ n->next = head;
+ head = n;
+ }
+
+ ListNode *start() const {return head;}
+protected:
+ ListNode *head;
+
+};
|