summaryrefslogtreecommitdiff
path: root/attache/FileInfo.h
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-11-01 14:28:18 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-11-01 14:28:18 +0000
commit31d3a6408d045eadaff094d4c11bf017817743d7 (patch)
tree61f75240490677d57477fea63d6f771bf3d754d9 /attache/FileInfo.h
parent31654bd814b4e5fdc1b68807e341c623d74f357d (diff)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@4 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'attache/FileInfo.h')
-rw-r--r--attache/FileInfo.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/attache/FileInfo.h b/attache/FileInfo.h
new file mode 100644
index 0000000..43a5c9f
--- /dev/null
+++ b/attache/FileInfo.h
@@ -0,0 +1,63 @@
+#pragma once
+
+#include "common.h"
+//#include <tchar.h>
+
+class FileInfo
+{
+ TCHAR m_fieldName[512];
+ TCHAR m_pathName[MAX_PATH];
+ TCHAR m_contentType[512];
+
+public:
+ FileInfo(TCHAR *lpszFieldName, TCHAR *lpszPathName, TCHAR *lpszContentType) {
+ _tcsncpy(m_fieldName, lpszFieldName, 512);
+ _tcsncpy(m_pathName, lpszPathName, MAX_PATH);
+ _tcsncpy(m_contentType, lpszContentType, 512);
+ }
+
+ FileInfo() {}
+ FileInfo(const FileInfo &other) {
+ memcpy(this, &other, sizeof(FileInfo));
+ }
+
+ const TCHAR *GetFieldName() const { return &m_fieldName[0]; }
+ const TCHAR *GetPathName() const { return &m_pathName[0]; }
+ const TCHAR *GetContentType() const { return &m_contentType[0]; }
+};
+
+//typedef std::vector< FileInfo > FileInfoCollection;
+class FileInfoList {
+public:
+ class ListNode {
+ public:
+ ListNode() {}
+ FileInfo info;
+ ListNode *next;
+ };
+
+ FileInfoList(): head(0) {}
+ ~FileInfoList() {clear();}
+
+ void clear() {
+ ListNode *n = head;
+ while(n) {
+ n = n->next;
+ delete head;
+ head = n;
+ }
+ }
+
+
+ void push_back(const FileInfo &info) {
+ ListNode *n = new ListNode;
+ n->info = info;
+ n->next = head;
+ head = n;
+ }
+
+ ListNode *start() const {return head;}
+protected:
+ ListNode *head;
+
+};