Merge branch 'linux-3.10.y' of git://git.kernel.org/pub/scm/linux/kernel/git/stable...
[firefly-linux-kernel-4.4.55.git] / tools / gator / daemon / OlyUtility.h
1 /**
2  * Copyright (C) ARM Limited 2010-2015. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #ifndef OLY_UTILITY_H
10 #define OLY_UTILITY_H
11
12 #include <stddef.h>
13
14 #ifdef WIN32
15 #define PATH_SEPARATOR '\\'
16 #define CAIMAN_PATH_MAX MAX_PATH
17 #define snprintf _snprintf
18 #else
19 #include <limits.h>
20 #define PATH_SEPARATOR '/'
21 #define CAIMAN_PATH_MAX PATH_MAX
22 #endif
23
24 class OlyUtility {
25 public:
26   OlyUtility() {};
27   ~OlyUtility() {};
28   bool stringToBool(const char* string, bool defValue);
29   void stringToLower(char* string);
30   int getApplicationFullPath(char* path, int sizeOfPath);
31   char* readFromDisk(const char* file, unsigned int *size = NULL, bool appendNull = true);
32   int writeToDisk(const char* path, const char* file);
33   int appendToDisk(const char* path, const char* file);
34   int copyFile(const char* srcFile, const char* dstFile);
35   const char* getFilePart(const char* path);
36   char* getPathPart(char* path);
37 private:
38 };
39
40 extern OlyUtility* util;
41
42 #endif // OLY_UTILITY_H