1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
5 // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //----------------------------------------------------------------------
10 BDataIO wrapper around a given attribute for a file. (declarations)
18 #include <SupportDefs.h>
20 std::string
bytes_to_string(uint64 bytes
);
27 time_t StartTime() const { return fStartTime
; }
28 time_t ElapsedTime() const { return real_time_clock() - fStartTime
; }
29 std::string
ElapsedTimeString() const;
31 void AddDirectory() { fDirectories
++; }
32 void AddFile() { fFiles
++; }
33 void AddSymlink() { fSymlinks
++; }
34 void AddAttribute() { fAttributes
++; }
36 void AddDirectoryBytes(uint64 count
) { fDirectoryBytes
+= count
; }
37 void AddFileBytes(uint64 count
) { fFileBytes
+= count
; }
39 void SetImageSize(uint64 size
) { fImageSize
= size
; }
41 uint64
Directories() const { return fDirectories
; }
42 uint64
Files() const { return fFiles
; }
43 uint64
Symlinks() const { return fSymlinks
; }
44 uint64
Attributes() const { return fAttributes
; }
46 uint64
DirectoryBytes() const { return fDirectoryBytes
; }
47 uint64
FileBytes() const { return fFileBytes
; }
48 std::string
DirectoryBytesString() const;
49 std::string
FileBytesString() const;
51 uint64
ImageSize() const { return fImageSize
; }
52 std::string
ImageSizeString() const;
59 uint64 fDirectoryBytes
;
64 #endif // _STATISTICS_H