~zorba-coders/zorba/bugs-912586-912593-912722

« back to all changes in this revision

Viewing changes to src/util/utf8_util_base.h

  • Committer: Cezar Andrei
  • Date: 2012-03-28 15:42:12 UTC
  • mfrom: (10606.1.129 zorba)
  • Revision ID: cezar.lp@cezarandrei.com-20120328154212-jh2heq49xcqjppce
Merge from trunck and resolve ChangeLog conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <iterator>
23
23
#include <stdexcept>
24
24
 
25
 
#include <zorba/config.h>
26
 
 
27
25
#include "unicode_util.h"
28
26
 
29
27
namespace zorba {
63
61
 * @param char_pos The character position.
64
62
 * @return Returns the corresponding byte position.
65
63
 */
66
 
ZORBA_DLL_PUBLIC
67
64
size_type byte_pos( storage_type const *s, size_type char_pos );
68
65
 
69
66
/**
75
72
 * @return Returns the corresponding byte position or \c npos if the result >=
76
73
 * \a s_size.
77
74
 */
78
 
ZORBA_DLL_PUBLIC
79
75
size_type byte_pos( storage_type const *s, size_type s_size,
80
76
                    size_type char_pos );
81
77
 
86
82
 * @param p A pointer to somewhere within \a s.
87
83
 * @return Returns said offset.
88
84
 */
89
 
ZORBA_DLL_PUBLIC
90
85
size_type char_pos( storage_type const *s, storage_type const *p );
91
86
 
92
87
/**
111
106
 * character.
112
107
 * @return Returns the number of bytes required to encode the character.
113
108
 */
114
 
ZORBA_DLL_PUBLIC
115
109
size_type encode( unicode::code_point c, storage_type **ps );
116
110
 
117
111
/**
149
143
 * @return Returns the Unicode code-point of the next character.
150
144
 */
151
145
template<class OctetIterator>
152
 
ZORBA_DLL_PUBLIC
153
146
unicode::code_point next_char( OctetIterator &i );
154
147
 
155
148
/**
234
227
 * @return Returns a number in the range [1,6] if \a start is valid or 0 if
235
228
 * \a start is invalid.
236
229
 */
237
 
ZORBA_DLL_PUBLIC
238
230
size_type char_length( storage_type start );
239
231
 
240
232
/**
244
236
 * @param s A pointer to the first byte of a NULL-terminated UTF-8 string.
245
237
 * @return Returns said number of characters.
246
238
 */
247
 
ZORBA_DLL_PUBLIC
248
239
size_type length( storage_type const *s );
249
240
 
250
241
/**
256
247
 * sequence.
257
248
 * @return Returns said number of characters.
258
249
 */
259
 
ZORBA_DLL_PUBLIC
260
250
size_type length( storage_type const *begin, storage_type const *end );
261
251
 
262
252
/**
321
311
 * @return Returns \c nullptr if the string is valid or a pointer to the first
322
312
 * invalid byte if invalid.
323
313
 */
324
 
ZORBA_DLL_PUBLIC
325
314
storage_type const* validate( storage_type const *s );
326
315
 
327
316
/**
332
321
 * @return Returns \c nullptr if the string is valid or a pointer to the first
333
322
 * invalid byte if invalid.
334
323
 */
335
 
ZORBA_DLL_PUBLIC
336
324
storage_type const* validate( storage_type const *s, size_type s_size );
337
325
 
338
326
////////// iterator ///////////////////////////////////////////////////////////