00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef URLC_H
00027 #define URLC_H
00028
00029 #include <fstream>
00030 #include <stdio.h>
00031
00032 #include "../oawconfig.h"
00033
00034 OAW_BEGIN_NAMESPACE
00035
00036 class OAW_DLLMAPPING UrlC
00037 {
00038 public:
00039 UrlC();
00040 UrlC(const char*);
00041 UrlC(const UrlC&);
00042 UrlC& operator = (const UrlC&);
00043 ~UrlC();
00044
00045 void SetUrlAddress(const char*);
00046 const char* GetUrlAddress();
00047
00048 void GetIFStream(std::ifstream&);
00049 void GetFStream(std::fstream&);
00050 FILE* GetFileHandle();
00051
00052 #ifdef _WIN32
00053 void GetData(char*,unsigned long, unsigned long&);
00054 long GetContentSize(){return m_slContentSize;}
00055 const char* GetContentType(){return m_contentType;}
00056
00057
00058 private:
00059 void GetDataFromFile(char*,unsigned long,unsigned long&);
00060 void GetDataFromInet(char*,unsigned long,unsigned long&);
00061 void OpenUrl();
00062 #endif
00063
00064 protected:
00065 char* m_urlAddress;
00066 char* m_localFilename;
00067 char* m_contentType;
00068 long m_slContentSize;
00069 void* m_hUrl;
00070 void* m_hFile;
00071 long m_ulBytesRead;
00072 };
00073
00074 OAW_END_NAMESPACE
00075
00076 #endif
00077
00078
00079
00080
00081
00082