Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2008-2010 Mozilla Foundation |
michael@0 | 3 | * |
michael@0 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
michael@0 | 5 | * copy of this software and associated documentation files (the "Software"), |
michael@0 | 6 | * to deal in the Software without restriction, including without limitation |
michael@0 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
michael@0 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
michael@0 | 9 | * Software is furnished to do so, subject to the following conditions: |
michael@0 | 10 | * |
michael@0 | 11 | * The above copyright notice and this permission notice shall be included in |
michael@0 | 12 | * all copies or substantial portions of the Software. |
michael@0 | 13 | * |
michael@0 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
michael@0 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
michael@0 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
michael@0 | 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
michael@0 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
michael@0 | 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
michael@0 | 20 | * DEALINGS IN THE SOFTWARE. |
michael@0 | 21 | */ |
michael@0 | 22 | |
michael@0 | 23 | #ifndef nsHtml5NamedCharacters_h |
michael@0 | 24 | #define nsHtml5NamedCharacters_h |
michael@0 | 25 | |
michael@0 | 26 | #include "jArray.h" |
michael@0 | 27 | #include "nscore.h" |
michael@0 | 28 | #include "nsDebug.h" |
michael@0 | 29 | #include "prlog.h" |
michael@0 | 30 | #include "nsMemory.h" |
michael@0 | 31 | |
michael@0 | 32 | struct nsHtml5CharacterName { |
michael@0 | 33 | uint16_t nameStart; |
michael@0 | 34 | uint16_t nameLen; |
michael@0 | 35 | #ifdef DEBUG |
michael@0 | 36 | int32_t n; |
michael@0 | 37 | #endif |
michael@0 | 38 | int32_t length() const; |
michael@0 | 39 | char16_t charAt(int32_t index) const; |
michael@0 | 40 | }; |
michael@0 | 41 | |
michael@0 | 42 | class nsHtml5NamedCharacters |
michael@0 | 43 | { |
michael@0 | 44 | public: |
michael@0 | 45 | static const nsHtml5CharacterName NAMES[]; |
michael@0 | 46 | static const char16_t VALUES[][2]; |
michael@0 | 47 | static char16_t** WINDOWS_1252; |
michael@0 | 48 | static void initializeStatics(); |
michael@0 | 49 | static void releaseStatics(); |
michael@0 | 50 | }; |
michael@0 | 51 | |
michael@0 | 52 | #endif // nsHtml5NamedCharacters_h |