vfs: check userland buffers before reading them.
[haiku.git] / src / apps / diskusage / Snapshot.h
blobaded614759a0cd3ccc7a01b8cba3c1fe0580b459
1 /*
2 * Copyright (c) 2008 Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
3 * Distributed under the terms of the MIT/X11 license.
5 * Copyright (c) 1999 Mike Steed. You are free to use and distribute this software
6 * as long as it is accompanied by it's documentation and this copyright notice.
7 * The software comes with no warranty, etc.
8 */
9 #ifndef SNAPSHOT_H
10 #define SNAPSHOT_H
13 #include <string>
14 #include <vector>
16 #include <Entry.h>
19 class BMimeType;
20 class BVolume;
22 using std::string;
23 using std::vector;
26 struct FileInfo {
27 FileInfo();
28 ~FileInfo();
30 void GetPath(std::string& path) const;
31 FileInfo* FindChild(const char* name) const;
32 BMimeType* Type() const;
34 bool pseudo;
35 entry_ref ref;
36 off_t size;
37 int count;
38 FileInfo* parent;
39 std::vector<FileInfo*> children;
41 int color;
45 struct VolumeSnapshot {
46 VolumeSnapshot(const BVolume* volume);
47 ~VolumeSnapshot();
49 std::string name;
50 off_t capacity;
51 off_t freeBytes;
52 FileInfo* rootDir;
53 FileInfo* freeSpace;
54 FileInfo* currentDir;
57 #endif // SNAPSHOT_H