summaryrefslogtreecommitdiffstats
path: root/src/uscxml/URL.h
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-12-15 19:10:50 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-12-15 19:10:50 (GMT)
commitf1700edcd08d6215888e226618555ba43b5324ec (patch)
tree738f30de64f699c3f56d2e15963537c9493a24b4 /src/uscxml/URL.h
parent2855a9ff7b423140237c9e988252fde0cbacd0a1 (diff)
downloaduscxml-f1700edcd08d6215888e226618555ba43b5324ec.zip
uscxml-f1700edcd08d6215888e226618555ba43b5324ec.tar.gz
uscxml-f1700edcd08d6215888e226618555ba43b5324ec.tar.bz2
Refactoring and plugin support
Diffstat (limited to 'src/uscxml/URL.h')
-rw-r--r--src/uscxml/URL.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/uscxml/URL.h b/src/uscxml/URL.h
index d6fc9ed..8438d3a 100644
--- a/src/uscxml/URL.h
+++ b/src/uscxml/URL.h
@@ -1,10 +1,41 @@
#ifndef URL_H_27HPRH76
#define URL_H_27HPRH76
-#include "Utilities.h"
+#include <string>
+#include <sstream>
+#include <curl/curl.h>
namespace uscxml {
+enum fcurl_type_e {
+ CFTYPE_NONE=0,
+ CFTYPE_FILE=1,
+ CFTYPE_CURL=2
+};
+
+struct fcurl_data
+{
+ enum fcurl_type_e type; /* type of handle */
+ union {
+ CURL *curl;
+ FILE *file;
+ } handle; /* handle */
+
+ char *buffer; /* buffer to store cached data*/
+ size_t buffer_len; /* currently allocated buffers length */
+ size_t buffer_pos; /* end of data in buffer*/
+ int still_running; /* Is background url fetch still in progress */
+};
+
+typedef struct fcurl_data URL_FILE;
+
+URL_FILE *url_fopen(const char *url,const char *operation);
+int url_fclose(URL_FILE *file);
+int url_feof(URL_FILE *file);
+size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
+char * url_fgets(char *ptr, size_t size, URL_FILE *file);
+void url_rewind(URL_FILE *file);
+
class URL {
public:
URL(const std::string urlString) : _urlString(urlString) {}