source: box/trunk/lib/common/Utils.h @ 2855

Revision 2855, 1.1 KB checked in by chris, 16 months ago (diff)

Move TemporaryDirectory?.h into Utils.h and Utils.cpp to avoid duplicate
definitions of inline functions.

  • Property svn:eol-style set to native
Line 
1// --------------------------------------------------------------------------
2//
3// File
4//              Name:    Utils.h
5//              Purpose: Utility function
6//              Created: 2003/07/31
7//
8// --------------------------------------------------------------------------
9
10#ifndef UTILS__H
11#define UTILS__H
12
13#include <string>
14#include <vector>
15
16#include "MemLeakFindOn.h"
17
18std::string GetBoxBackupVersion();
19
20void SplitString(const std::string &String, char SplitOn, std::vector<std::string> &rOutput);
21
22#ifdef SHOW_BACKTRACE_ON_EXCEPTION
23        void DumpStackBacktrace();
24#endif
25
26bool FileExists(const std::string& rFilename, int64_t *pFileSize = 0,
27        bool TreatLinksAsNotExisting = false);
28
29enum
30{
31        ObjectExists_NoObject = 0,
32        ObjectExists_File = 1,
33        ObjectExists_Dir = 2
34};
35int ObjectExists(const std::string& rFilename);
36std::string HumanReadableSize(int64_t Bytes);
37std::string FormatUsageBar(int64_t Blocks, int64_t Bytes, int64_t Max,
38        bool MachineReadable);
39std::string FormatUsageLineStart(const std::string& rName,
40        bool MachineReadable);
41
42std::string BoxGetTemporaryDirectoryName();
43
44#include "MemLeakFindOff.h"
45
46#endif // UTILS__H
Note: See TracBrowser for help on using the repository browser.