cheshirekow  v0.1.0
string.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of cppfontconfig.
5  *
6  * cppfontconfig is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * cppfontconfig is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with cppfontconfig. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef CPPFONTCONFIG_STRING_H_
28 #define CPPFONTCONFIG_STRING_H_
29 
30 #include <cpp_fontconfig/common.h>
31 
32 namespace fontconfig {
33 
34 const unsigned int UTF8_MAX_LEN = 6;
35 
36 namespace str {
37 
38 
39 Char8_t* copy (const Char8_t* s);
40 
41 Char8_t* copyFilename (const Char8_t* s);
42 
43 Char8_t* plus (const Char8_t* s1, const Char8_t* s2);
44 
45 void free (Char8_t* s);
46 
47 // These are ASCII only, suitable only for pattern element names
48 bool isUpper(Char8_t c);
49 bool isLower(Char8_t c);
50 bool toLower(Char8_t c);
51 
52 Char8_t* downcase (const Char8_t* s);
53 
54 int cmpIgnoreCase (const Char8_t* s1, const Char8_t* s2);
55 
56 int cmp (const Char8_t* s1, const Char8_t* s2);
57 
58 const Char8_t* strIgnoreCase (const Char8_t* s1, const Char8_t* s2);
59 
60 const Char8_t* str (const Char8_t* s1, const Char8_t* s2);
61 
62 int Utf8ToUcs4 ( const Char8_t* src_orig,
63  Char32_t* dst,
64  int len);
65 
66 bool Utf8Len (const Char8_t* string,
67  int len,
68  int* nchar,
69  int* wchar);
70 
71 int Ucs4ToUtf8 (Char32_t ucs4,
72  Char8_t dest[UTF8_MAX_LEN]);
73 
74 int Utf16ToUcs4 ( const Char8_t* src_orig,
75  Endian_t endian,
76  Char32_t* dst,
77  int len); // in bytes
78 
79 bool Utf16Len ( const Char8_t* string,
80  Endian_t endian,
81  int len, // in bytes
82  int* nchar,
83  int* wchar);
84 
85 Char8_t* dirname (const Char8_t* file);
86 
87 Char8_t* basename (const Char8_t* file);
88 
89 
90 
91 }
92 }
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 #endif // STRING_H_
bool toLower(Char8_t c)
unsigned int Char32_t
Definition: common.h:67
int cmp(const Char8_t *s1, const Char8_t *s2)
int Ucs4ToUtf8(Char32_t ucs4, Char8_t dest[UTF8_MAX_LEN])
bool isUpper(Char8_t c)
Char8_t * downcase(const Char8_t *s)
void free(Char8_t *s)
unsigned char Char8_t
Definition: common.h:65
Char8_t * plus(const Char8_t *s1, const Char8_t *s2)
bool Utf8Len(const Char8_t *string, int len, int *nchar, int *wchar)
int Utf8ToUcs4(const Char8_t *src_orig, Char32_t *dst, int len)
bool Utf16Len(const Char8_t *string, Endian_t endian, int len, int *nchar, int *wchar)
int Utf16ToUcs4(const Char8_t *src_orig, Endian_t endian, Char32_t *dst, int len)
Char8_t * dirname(const Char8_t *file)
int cmpIgnoreCase(const Char8_t *s1, const Char8_t *s2)
const Char8_t * str(const Char8_t *s1, const Char8_t *s2)
bool isLower(Char8_t c)
Char8_t * copy(const Char8_t *s)
const Char8_t * strIgnoreCase(const Char8_t *s1, const Char8_t *s2)
Char8_t * copyFilename(const Char8_t *s)
const unsigned int UTF8_MAX_LEN
Definition: string.h:34
Char8_t * basename(const Char8_t *file)