file_info.h

Go to the documentation of this file.
00001 #ifndef FILE_INFO_CLASS
00002 #define FILE_INFO_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : file_info                                                         *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1993-$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 "filename.h"
00019 
00020 #include <basis/object_base.h>
00021 
00023 
00024 class OPSYSTEM_CLASS_STYLE file_info : public filename 
00025 {
00026 public:
00027   double _file_size;  
00028   int _checksum;  
00029 
00030   file_info(const filename &to_copy = filename(), double file_size = 0,
00031           int checksum = 0);
00033 
00034   file_info(const file_info &to_copy);
00035 
00036   virtual ~file_info();
00037 
00038   IMPLEMENT_CLASS_NAME("file_info");
00039 
00040   file_info &operator = (const file_info &to_copy);
00041 
00042   istring text_form() const;
00043 
00044   bool calculate(const istring &prefix, bool just_size = false,
00045         int checksum_edge = 512 * KILOBYTE);
00047 
00055   const istring &secondary() const;
00057   void secondary(const istring &new_sec) const;
00059 
00060   const byte_array &attachment() const;
00062 
00064   void attachment(const byte_array &new_attachment);
00066 
00067   // standard streaming operations.
00068   virtual void pack(byte_array &packed_form) const;
00069   virtual bool unpack(byte_array &packed_form);
00070 
00071 private:
00072   istring *_secondary;  
00073   byte_array *_attachment;  
00074 };
00075 
00076 #endif
00077 

Generated on Fri Nov 28 04:29:22 2008 for HOOPLE Libraries by  doxygen 1.5.1