nlib
StringPrep.h
Go to the documentation of this file.
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_UNICODE_STRINGPREP_H_
17 #define INCLUDE_NN_NLIB_UNICODE_STRINGPREP_H_
18 
19 #include "nn/nlib/Config.h"
20 
21 NLIB_NAMESPACE_BEGIN
22 namespace unicode {
23 
25  size_t n;
26  uint32_t code[4];
27 };
28 
30  // See RFC3454
31  public:
32  NLIB_VIS_PUBLIC static bool InTableA1(uint32_t utf32) NLIB_NOEXCEPT;
33 
34  NLIB_VIS_PUBLIC static bool InTableB1(uint32_t utf32) NLIB_NOEXCEPT;
35  NLIB_VIS_PUBLIC static bool MapTableB2(uint32_t utf32, StringPrepMapResult* m) NLIB_NOEXCEPT;
36  NLIB_VIS_PUBLIC static bool MapTableB3(uint32_t utf32, StringPrepMapResult* m) NLIB_NOEXCEPT;
37 
38  static bool InTableC11(uint32_t utf32) NLIB_NOEXCEPT { return utf32 == 0x0020; }
39  NLIB_VIS_PUBLIC static bool InTableC12(uint32_t utf32) NLIB_NOEXCEPT;
40  static bool InTableC21(uint32_t utf32) NLIB_NOEXCEPT {
41  return utf32 < 0x0020 || utf32 == 0x007F;
42  }
43  NLIB_VIS_PUBLIC static bool InTableC22(uint32_t utf32) NLIB_NOEXCEPT;
44 
45  NLIB_VIS_PUBLIC static bool InTableC3(uint32_t utf32) NLIB_NOEXCEPT;
46  NLIB_VIS_PUBLIC static bool InTableC4(uint32_t utf32) NLIB_NOEXCEPT;
47  static bool InTableC5(uint32_t utf32) NLIB_NOEXCEPT {
48  return utf32 >= 0xD800 && utf32 <= 0xDFFF;
49  }
50  static bool InTableC6(uint32_t utf32) NLIB_NOEXCEPT {
51  return utf32 >= 0xFFF9 && utf32 <= 0xFFFD;
52  }
53  static bool InTableC7(uint32_t utf32) NLIB_NOEXCEPT {
54  return utf32 >= 0x2FF0 && utf32 <= 0x2FFB;
55  }
56  NLIB_VIS_PUBLIC static bool InTableC8(uint32_t utf32) NLIB_NOEXCEPT;
57  static bool InTableC9(uint32_t utf32) NLIB_NOEXCEPT {
58  return utf32 == 0xE0001 || (utf32 >= 0xE0020 && utf32 <= 0xE007F);
59  }
60  NLIB_VIS_PUBLIC static bool InTableD1(uint32_t utf32) NLIB_NOEXCEPT;
61  NLIB_VIS_PUBLIC static bool InTableD2(uint32_t utf32) NLIB_NOEXCEPT;
62 };
63 
64 } // namespace unicode
65 NLIB_NAMESPACE_END
66 
67 #endif // INCLUDE_NN_NLIB_UNICODE_STRINGPREP_H_
static bool InTableC9(uint32_t utf32) noexcept
Determines whether the character is described in RFC 3454, C.9 (Tagging characters).
Definition: StringPrep.h:57
Implements various tables defined in RFC3454.
Definition: StringPrep.h:29
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:89
Data structure to store mapping results from StringPrep.
Definition: StringPrep.h:24
static bool InTableC11(uint32_t utf32) noexcept
Determines whether the character is described in RFC 3454, C.1.1 (ASCII space characters).
Definition: StringPrep.h:38
size_t n
Number of characters stored in StringPrepMapResult::code.
Definition: StringPrep.h:25
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:99
A file that contains the configuration information for each development environment.
static bool InTableC5(uint32_t utf32) noexcept
Determines whether the character is described in RFC 3454, C.5 (Surrogate codes). ...
Definition: StringPrep.h:47
static bool InTableC6(uint32_t utf32) noexcept
Determines whether the character is described in RFC 3454, C.6 (Inappropriate for plain text)...
Definition: StringPrep.h:50
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:229
static bool InTableC21(uint32_t utf32) noexcept
Determines whether the character is described in RFC 3454, C.2.1 (ASCII control characters).
Definition: StringPrep.h:40
static bool InTableC7(uint32_t utf32) noexcept
Determines whether the character is described in RFC 3454, C.7 (Inappropriate for canonical represent...
Definition: StringPrep.h:53