1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/parser/html/nsHtml5NamedCharacters.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +/* 1.5 + * Copyright (c) 2008-2010 Mozilla Foundation 1.6 + * 1.7 + * Permission is hereby granted, free of charge, to any person obtaining a 1.8 + * copy of this software and associated documentation files (the "Software"), 1.9 + * to deal in the Software without restriction, including without limitation 1.10 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 1.11 + * and/or sell copies of the Software, and to permit persons to whom the 1.12 + * Software is furnished to do so, subject to the following conditions: 1.13 + * 1.14 + * The above copyright notice and this permission notice shall be included in 1.15 + * all copies or substantial portions of the Software. 1.16 + * 1.17 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1.18 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1.19 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1.20 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1.21 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1.22 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1.23 + * DEALINGS IN THE SOFTWARE. 1.24 + */ 1.25 + 1.26 +#ifndef nsHtml5NamedCharacters_h 1.27 +#define nsHtml5NamedCharacters_h 1.28 + 1.29 +#include "jArray.h" 1.30 +#include "nscore.h" 1.31 +#include "nsDebug.h" 1.32 +#include "prlog.h" 1.33 +#include "nsMemory.h" 1.34 + 1.35 +struct nsHtml5CharacterName { 1.36 + uint16_t nameStart; 1.37 + uint16_t nameLen; 1.38 + #ifdef DEBUG 1.39 + int32_t n; 1.40 + #endif 1.41 + int32_t length() const; 1.42 + char16_t charAt(int32_t index) const; 1.43 +}; 1.44 + 1.45 +class nsHtml5NamedCharacters 1.46 +{ 1.47 + public: 1.48 + static const nsHtml5CharacterName NAMES[]; 1.49 + static const char16_t VALUES[][2]; 1.50 + static char16_t** WINDOWS_1252; 1.51 + static void initializeStatics(); 1.52 + static void releaseStatics(); 1.53 +}; 1.54 + 1.55 +#endif // nsHtml5NamedCharacters_h