#ifndef RDIRSRCHSRV_H #define RDIRSRCHSRV_H //$Id: RDirSrchSrv.h,v 1.15 2006/06/03 21:32:37 markus Rel $ // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include namespace YGP { class CommError; /**Class for a server to enable remote directory searching. This is the server for the RemoteDirSearch-class. Supported commands are: - -> Check="<file>"
<- RC=0 - -> Find="<file>";Attr=<attr>
<- RC=0;%File="<file>";Size=<size>Time=<timestamp>Attr=<attributes> - -> Next
<- RC=0;%File="<file>";Size=<size>Time=<timestamp>Attr=<attributes> - -> End
<- RC=0 - -> Open="<file>";Mode=<mode>
<- RC=0;ID=<ID> - -> Read="<ID>";Length=<length>
<- RC=0;Length=<length>;Data=<data> - -> Write=<ID>;Length=<length>;Data="<data>"
<- RC=0 - -> EOF=<ID>
<- RC=0 - -> Close=<ID>
<- RC=0 Errors are reported in the following format: - RC=<status>[;E=<errortext>] */ class RemoteDirSearchSrv { public: //@Section manager-functions RemoteDirSearchSrv (); ~RemoteDirSearchSrv (); int performCommands (int socket) throw (YGP::CommError); private: void writeResult (Socket& socket, const File& result) const throw (YGP::CommError); int writeError (Socket& socket, int error, bool desc = false) const throw (YGP::CommError); void handleArgError (Socket& sock, const std::string& error) const; }; } #endif // RDIRSRCHSRV