diff options
Diffstat (limited to 'attache/UploadSettings.h')
-rw-r--r-- | attache/UploadSettings.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/attache/UploadSettings.h b/attache/UploadSettings.h new file mode 100644 index 0000000..d7cd0dc --- /dev/null +++ b/attache/UploadSettings.h @@ -0,0 +1,40 @@ +#pragma once
+#include "FileInfo.h"
+#include "FieldInfo.h"
+
+class UploadSettings
+{
+ TCHAR m_strHostName[1024];
+ TCHAR m_strUrlPath[MAX_PATH];
+
+ FileInfoList m_files;
+ FieldInfoList m_fields;
+
+ DWORD m_dwCachedBytesPerSecond;
+
+ // A random guess: 56Kbps modem (ish)
+ static const DWORD INITIAL_ESTIMATED_TRANSFER_RATE = 5600;
+
+public:
+ UploadSettings()
+ : m_dwCachedBytesPerSecond(INITIAL_ESTIMATED_TRANSFER_RATE)
+ {
+ }
+
+ bool SetAddress(TCHAR *lpszAddress);
+
+ TCHAR *GetAddress() const;
+ const TCHAR *GetHostName() const { return &m_strHostName[0]; }
+ const TCHAR *GetUrlPath() const { return &m_strUrlPath[0]; }
+
+ void ClearFiles();
+ void AddFile(TCHAR *lpszFieldName, TCHAR *lpszFileName, TCHAR *lpszContentType);
+ void GetFiles(FileInfoList *pFiles) const;
+
+ void ClearFields();
+ void AddField(TCHAR *lpszFieldName, TCHAR *lpszFieldValue);
+ void GetFields(FieldInfoList *pFields) const;
+
+ DWORD GetCachedBytesPerSecond() const { return m_dwCachedBytesPerSecond; }
+ void SetCachedBytesPerSecond(DWORD dwBytesPerSecond) { m_dwCachedBytesPerSecond = dwBytesPerSecond; }
+};
|