Differences From Artifact [5e9e46c622]:
- File src/OFString.h — part of check-in [374956b098] at 2012-12-29 14:43:05 on branch trunk — Prettify some code. (user: js, size: 29163) [annotate] [blame] [check-ins using]
To Artifact [05df72695a]:
- File
src/OFString.h
— part of check-in
[640b225ba7]
at
2012-12-29 17:56:05
on branch trunk
— OFString: Improve API for Unicode strings.
* Instead of Unicode "strings", it uses the term "Unicode character
array".
* No terminating 0 character anymore, as these are not C strings
anyway. (user: js, size: 26791) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
133 134 135 136 137 138 139 | * @brief Creates a new OFString from another string. * * @param string A string to initialize the OFString with * @return A new autoreleased OFString */ + (instancetype)stringWithString: (OFString*)string; | < < < < < < < < < < < < < < < < < < < | | | | | > < | < | < < < < < < < < < < < < < < < < < < | < > < | > | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | * @brief Creates a new OFString from another string. * * @param string A string to initialize the OFString with * @return A new autoreleased OFString */ + (instancetype)stringWithString: (OFString*)string; /*! * @brief Creates a new OFString from a unicode string with the specified * length. * * @param characters An array of unicode characters * @param length The length of the unicode character array * @return A new autoreleased OFString */ + (instancetype)stringWithCharacters: (const of_unichar_t*)characters length: (size_t)length; /*! * @brief Creates a new OFString from a unicode string with the specified * length, assuming the specified byte order if no BOM is found. * * @param characters An array of unicode characters * @param length The length of the unicode character array * @param byteOrder The byte order to assume if there is no BOM * @return A new autoreleased OFString */ + (instancetype)stringWithCharacters: (const of_unichar_t*)characters length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Creates a new OFString from a big endian UTF-16 encoded string with * the specified length. * * @param string The UTF-16 string * @param length The length of the unicode string * @return A new autoreleased OFString */ + (instancetype)stringWithUTF16String: (const uint16_t*)string length: (size_t)length; /*! * @brief Creates a new OFString from a UTF-16 encoded string with the * specified length, assuming the specified byte order if no BOM is * found. * * @param string The UTF-16 string * @param length The length of the unicode string * @param byteOrder The byte order to assume if there is no BOM * @return A new autoreleased OFString */ + (instancetype)stringWithUTF16String: (const uint16_t*)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Creates a new OFString from a format string. * * See printf for the format syntax. As an addition, %@ is available as format * specifier for objects. * |
︙ | ︙ | |||
350 351 352 353 354 355 356 | * @brief Initializes an already allocated OFString with another string. * * @param string A string to initialize the OFString with * @return An initialized OFString */ - initWithString: (OFString*)string; | < < < < < < < < < < < < < < < < < < < | | | | | > < | < | < < < < < < < < < < < < < < < < < < | < > < | > | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | * @brief Initializes an already allocated OFString with another string. * * @param string A string to initialize the OFString with * @return An initialized OFString */ - initWithString: (OFString*)string; /*! * @brief Initializes an already allocated OFString with a unicode string with * the specified length. * * @param characters An array of unicode characters * @param length The length of the unicode character array * @return An initialized OFString */ - initWithCharacters: (const of_unichar_t*)characters length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a unicode string with * the specified length, assuming the specified byte order if no BOM is * found. * * @param characters An array of unicode characters * @param length The length of the unicode character array * @param byteOrder The byte order to assume if there is no BOM * @return An initialized OFString */ - initWithCharacters: (const of_unichar_t*)characters length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a UTF-16 string with * the specified length. * * @param string The UTF-16 string * @param length The length of the UTF-16 string * @return An initialized OFString */ - initWithUTF16String: (const uint16_t*)string length: (size_t)length; /*! * @brief Initializes an already allocated OFString with a UTF-16 string with * the specified length, assuming the specified byte order if no BOM is * found. * * @param string The UTF-16 string * @param length The length of the UTF-16 string * @param byteOrder The byte order to assume if there is no BOM * @return An initialized OFString */ - initWithUTF16String: (const uint16_t*)string length: (size_t)length byteOrder: (of_byte_order_t)byteOrder; /*! * @brief Initializes an already allocated OFString with a format string. * * See printf for the format syntax. As an addition, %@ is available as format * specifier for objects. * |
︙ | ︙ | |||
905 906 907 908 909 910 911 | * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The string as an array of Unicode characters */ | | | 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The string as an array of Unicode characters */ - (const of_unichar_t*)characters OF_RETURNS_INNER_POINTER; /*! * @brief Returns the string in big endian UTF-16 encoding. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. |
︙ | ︙ | |||
954 955 956 957 958 959 960 | #endif #ifdef __cplusplus extern "C" { #endif extern size_t of_string_utf8_encode(of_unichar_t, char*); extern size_t of_string_utf8_decode(const char*, size_t, of_unichar_t*); | < < | 878 879 880 881 882 883 884 885 886 887 | #endif #ifdef __cplusplus extern "C" { #endif extern size_t of_string_utf8_encode(of_unichar_t, char*); extern size_t of_string_utf8_decode(const char*, size_t, of_unichar_t*); #ifdef __cplusplus } #endif |