00001 #ifndef FILE_TRANSFER_INFOTON_CLASS 00002 #define FILE_TRANSFER_INFOTON_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : file_transfer_infoton * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2005-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #include "dll_tentacles.h" 00019 00020 #include <basis/byte_array.h> 00021 #include <octopus/infoton.h> 00022 00023 // forward. 00024 class directory_tree; 00025 00027 00031 class TENTACLES_CLASS_STYLE file_transfer_infoton : public infoton 00032 { 00033 public: 00035 enum commands { 00036 TREE_COMPARISON = 1, 00038 00043 PLACE_FILE_CHUNKS 00045 00052 }; 00053 00054 outcome _success; 00055 bool _request; 00056 byte _command; 00057 istring _src_root; 00058 istring _dest_root; 00059 byte_array _packed_data; 00060 00061 file_transfer_infoton(); 00062 00063 file_transfer_infoton(const outcome &success, bool request, commands command, 00064 const istring &source, const istring &destination, 00065 const byte_array &packed_data); 00066 00067 virtual ~file_transfer_infoton(); 00068 00069 virtual void pack(byte_array &packed_form) const; 00070 virtual bool unpack(byte_array &packed_form); 00071 00072 void package_tree_info(const directory_tree &tree, 00073 const string_array &includes); 00075 00076 virtual clonable *clone() const 00077 { return cloner<file_transfer_infoton>(*this); } 00078 00079 virtual int packed_size() const; 00080 00081 static const string_array &file_transfer_classifier(); 00083 }; 00084 00085 #endif 00086
1.5.1