00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef __SESSION_H
00013 #define __SESSION_H
00014
00015 #include <string>
00016 #include <vector>
00017
00018 #include <Common.h>
00019 #include <UserProfile.h>
00020 #include <Document.h>
00021 #include <ISocket.h>
00022
00027 class Session
00028 {
00029 public:
00030
00034 Session();
00035
00039 ~Session();
00040
00045 bool srconnect( string server, int port );
00046
00052 bool login( UserProfile profile );
00053
00060 bool deleteDocument(NumID docid);
00061
00069 bool createDocument(Document metadata, NumID &docid);
00070
00081 bool changeDocument(NumID docid, string mimetype, char *filedata,
00082 int64_t bytecount, string filename, int64_t &revid);
00083
00090 bool deleteRevision(NumID docid, NumID revid);
00091
00095 bool addRendition(NumID docid, NumID revid, string mimetype,
00096 char *filedata, int64_t bytecount);
00097
00104 bool getDocumentInfo(NumID docid, Document &metadata);
00105
00112 bool changeDocumentInfo(NumID docid, Document metadata);
00113
00122 bool getDocument(NumID docid, NumID revid, string mimetype, string &file);
00123
00124
00125 private:
00126 void tokenize( string str, vector<string> &tokens );
00127
00128 int clientfd;
00129 ISocket *sock;
00130 bool connected;
00131
00132 };
00133
00134 #endif