v1.03 prerelease - Full Linux port of crnlib/crunch, in progress - still more testing to do, and some cmd line options (such as -timestamp) don't work under linux yet, but the core stuff (compression/decompression/transcoding) should work fine and performance under Linux is comparable to Windows. The 3 examples haven't been ported yet.

This commit is contained in:
richgel99@gmail.com
2012-04-26 07:14:21 +00:00
parent fffd983ffa
commit f63e26aee6
89 changed files with 3547 additions and 3829 deletions
+19 -43
View File
@@ -2,58 +2,34 @@
// See Copyright Notice and license at the end of inc/crnlib.h
#pragma once
#ifdef WIN32
#define CRNLIB_PATH_SEPERATOR_CHAR '\\'
#else
#define CRNLIB_PATH_SEPERATOR_CHAR '/'
#endif
namespace crnlib
{
char* crn_strdup(const char* pStr);
int crn_stricmp(const char *p, const char *q);
char* strcpy_safe(char* pDst, uint dst_len, const char* pSrc);
bool int_to_string(int value, char* pDst, uint len);
bool uint_to_string(uint value, char* pDst, uint len);
bool string_to_int(const char*& pBuf, int& value);
bool string_to_int(const wchar_t*& pBuf, int& value);
bool string_to_uint(const char*& pBuf, uint& value);
bool string_to_uint(const wchar_t*& pBuf, uint& value);
bool string_to_int64(const char*& pBuf, int64& value);
bool string_to_uint64(const char*& pBuf, uint64& value);
bool string_to_bool(const char* p, bool& value);
bool string_to_bool(const wchar_t* p, bool& value);
bool string_to_float(const char*& p, float& value, uint round_digit = 10U);
bool string_to_float(const wchar_t*& p, float& value, uint round_digit = 10U);
bool split_path(const char* p, dynamic_string* pDrive, dynamic_string* pDir, dynamic_string* pFilename, dynamic_string* pExt);
bool split_path(const wchar_t* p, dynamic_wstring* pDrive, dynamic_wstring* pDir, dynamic_wstring* pFilename, dynamic_wstring* pExt);
bool split_path(const char* p, dynamic_string& path, dynamic_string& filename);
bool split_path(const wchar_t* p, dynamic_wstring& path, dynamic_wstring& filename);
bool get_pathname(const char* p, dynamic_string& path);
bool get_pathname(const wchar_t* p, dynamic_wstring& path);
bool get_filename(const char* p, dynamic_string& filename);
bool get_filename(const wchar_t* p, dynamic_wstring& filename);
void combine_path(dynamic_string& dst, const char* pA, const char* pB);
void combine_path(dynamic_wstring& dst, const wchar_t* pA, const wchar_t* pB);
void combine_path(dynamic_string& dst, const char* pA, const char* pB, const char* pC);
void combine_path(dynamic_wstring& dst, const wchar_t* pA, const wchar_t* pB, const wchar_t* pC);
void combine_path(dynamic_wstring& dst, const wchar_t* pA, const wchar_t* pB, const wchar_t* pC, const wchar_t *pD);
bool full_path(dynamic_string& path);
bool full_path(dynamic_wstring& path);
bool get_extension(dynamic_string& filename);
bool get_extension(dynamic_wstring& filename);
bool remove_extension(dynamic_string& filename);
bool remove_extension(dynamic_wstring& filename);
bool create_path(const dynamic_wstring& path);
void trim_trailing_seperator(dynamic_wstring& path);
bool string_to_float(const char*& p, float& value, uint round_digit = 512U);
bool string_to_double(const char*& p, double& value, uint round_digit = 512U);
bool string_to_double(const char*& p, const char *pEnd, double& value, uint round_digit = 512U);
} // namespace crnlib