00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef FREE_INFO_H
00024 #define FREE_INFO_H
00025
00026 #include <ostream>
00027
00028 #include "storage/StorageInterface.h"
00029 #include "storage/XmlFile.h"
00030
00031
00032 namespace storage
00033 {
00034 class Volume;
00035
00036
00037 class FreeInfo
00038 {
00039
00040 public:
00041
00042 FreeInfo(bool resize_cached, const ResizeInfo& resize_info,
00043 bool content_cached, const ContentInfo& content_info)
00044 : resize_cached(resize_cached), resize_info(resize_info),
00045 content_cached(content_cached), content_info(content_info) {}
00046
00047 FreeInfo(const xmlNode* node);
00048
00049 void saveData(xmlNode* node) const;
00050
00051 bool resize_cached;
00052 ResizeInfo resize_info;
00053
00054 bool content_cached;
00055 ContentInfo content_info;
00056
00057 void update(bool resize_cached, const ResizeInfo& resize_info,
00058 bool content_cached, const ContentInfo& content_info);
00059
00060 static ResizeInfo detectResizeInfo(const string& mp, const Volume& vol);
00061 static ContentInfo detectContentInfo(const string& mp, const Volume& vol);
00062
00063 protected:
00064
00065 static bool isWindows(const string& mp);
00066 static unsigned numHomes(const string& mp);
00067
00068 };
00069
00070 std::ostream& operator<<(std::ostream& s, const ResizeInfo& resize_info);
00071 std::ostream& operator<<(std::ostream& s, const ContentInfo& content_info);
00072 std::ostream& operator<<(std::ostream& s, const FreeInfo& free_info);
00073
00074 }
00075
00076
00077 #endif