blob: 1525081a97a33389fa258791974127c715ed5db8 [file] [log] [blame]
Jon Medhurstaaf37a32013-06-11 12:10:56 +01001/**
Jon Medhurstb1d07442015-05-08 12:04:18 +01002 * Copyright (C) ARM Limited 2010-2015. All rights reserved.
Jon Medhurstaaf37a32013-06-11 12:10:56 +01003 *
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
24class OlyUtility {
25public:
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);
37private:
38};
39
40extern OlyUtility* util;
41
42#endif // OLY_UTILITY_H