00001 #ifndef XMLNetFileH 00002 #define XMLNetFileH 00003 00004 /******************************************************************************* 00005 Copyright 2002 Petr Kulhanek 00006 00007 This file is part of Core plugin. 00008 00009 Core plugin is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 2 of the License, or 00012 (at your option) any later version. 00013 00014 Core plugin is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with Core plugin; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 *******************************************************************************/ 00023 00024 /******************************************************************************* 00025 ** PROJEKT: Projekt molekulového modelování 00026 ** SOUBOR: XMLNetFile 00027 ** ÚČEL: wraper for net read/write of XMLFile 00028 ** VERZE: 1.0 00029 ** JAZYK: CBuilder C++ 00030 ** CÍLOVÝ POČÍTAČ: IBM PC 00031 ** PROGRAMÁTOR: Petr Kulhánek 00032 ** HISTORIE ÚPRAV: 00033 VERZE DATUM POZNÁMKA 00034 1.0 2002-08-25 00035 *******************************************************************************/ 00036 00040 #include "XMLFile.h" 00041 00042 00043 #include <scktcomp.hpp> 00044 00045 //--------------------------------------------------------------------------- 00046 00047 class CXMLNetFile : public CXMLFile{ 00048 public: 00049 __fastcall CXMLNetFile(void); 00050 00051 bool __fastcall ReadData(TCustomWinSocket* Socket); 00052 bool __fastcall WriteData(TCustomWinSocket* Socket); 00053 00054 bool __fastcall ReadFromStream(TStream* p_str); 00055 bool __fastcall WriteToStream(TStream* p_str); 00056 00057 private: 00058 class CHeader{ 00059 public: 00060 int Version; 00061 int DataSize; 00062 int Size; 00063 bool Compressed; 00064 }; 00065 TCustomWinSocket* MySocket; 00066 int NumOfRepeats; 00067 int TimeOut; 00068 00069 bool ReadBuffer(char* buffer,int length); 00070 bool WriteBuffer(char* buffer,int length); 00071 }; 00072 00073 //--------------------------------------------------------------------------- 00074 #endif