-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathutilities.hpp
43 lines (35 loc) · 1.11 KB
/
utilities.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// FILE_FLAG_NO_BUFFERING (Windows only) disk I/O must be sector aligned. AIO_MAX_SECTOR_SIZE must equal
// the largest disk sector size that can exist
#ifndef UTILITIES_HEADER
#define UTILITIES_HEADER
#include <string>
using namespace std;
#if defined(_WIN32) || defined(__WIN32__) || defined(_WIN64)
#define WINDOWS
#endif
#ifdef WINDOWS
#include "pthread.h"
#else
#include <pthread.h>
#endif
#define _CRT_SECURE_NO_WARNINGS
string ucase(string str);
string lcase(string str);
string remove_leading_curdir(string path);
string remove_delimitor(string path);
void utils_yield(void);
char *absolute_path(char *source, char *destination);
void abort(const char *fmt, ...);
string get_pid(void);
unsigned int adler(unsigned char *data, size_t len, unsigned int crc);
bool exists(string file);
bool is_dir(string path);
string str(int intValue);
string delimiter(long long l);
void *aligned_memory_alloc(size_t size, size_t alignment);
void aligned_free(void *ptr);
void *aligned_realloc(void *ptr, size_t size, size_t alignment);
#ifndef WINDOWS
unsigned int GetTickCount();
#endif
#endif