28 #ifndef _ID3LIB_UTILS_H_ 29 #define _ID3LIB_UTILS_H_ 31 #if defined HAVE_CONFIG_H 35 #include "id3/id3lib_streams.h" 37 #include "id3/id3lib_strings.h" 42 # define ID3_PATH_LENGTH (MAXPATHLEN + 1) 43 #elif defined (PATH_MAX) 44 # define ID3_PATH_LENGTH (PATH_MAX + 1) 46 # define ID3_PATH_LENGTH (2048 + 1) 51 const T&
min(
const T& a,
const T& b)
53 return (a < b) ? a : b;
59 const T&
max(
const T& a,
const T& b)
61 return (b < a) ? a : b;
67 const T&
mid(
const T& lo,
const T&
mid,
const T& hi)
69 return max(lo,
min(mid, hi));
77 return (a < T(0)) ? -a : a;
const T & min(const T &a, const T &b)
size_t ID3_C_EXPORT getFileSize(fstream &)
const T & mid(const T &lo, const T &mid, const T &hi)
size_t ID3_C_EXPORT renderNumber(uchar *buffer, uint32 val, size_t size=sizeof(uint32))
String ID3_C_EXPORT convert(String data, ID3_TextEnc, ID3_TextEnc)
size_t ID3_C_EXPORT ucslen(const unicode_t *unicode)
ID3_TextEnc
Enumeration of the types of text encodings: ascii or unicode.
ID3_Err ID3_C_EXPORT openReadableFile(String, fstream &)
ID3_Err
Predefined id3lib error types.
#define ID3_C_EXPORT
This file defines common macros, types, constants, and enums used throughout id3lib.
String ID3_C_EXPORT toString(uint32 val)
const T & max(const T &a, const T &b)
ID3_Err ID3_C_EXPORT openWritableFile(String, fstream &)
WString ID3_C_EXPORT toWString(const unicode_t[], size_t)
ID3_Err ID3_C_EXPORT createFile(String, fstream &)