Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

Session.h

00001 /*
00002    Copyright (C) 2002 the Strongroom project
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    @author Wouter de Vries
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

Generated on Wed Feb 18 13:45:55 2004 for strongroom by doxygen1.2.18