1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef mozilla_intl_Quotes_h__ 7 #define mozilla_intl_Quotes_h__ 8 9 #include "nsAtom.h" 10 11 namespace mozilla { 12 namespace intl { 13 14 // Currently, all the quotation characters provided by CLDR are single BMP 15 // codepoints, so they fit into char16_t fields. If there are ever multi- 16 // character strings or non-BMP codepoints in a future version, we'll need 17 // to extend this to a larger/more flexible structure, but for now it's 18 // deliberately kept simple and lightweight. 19 struct Quotes { 20 // Entries in order [open, close, alternativeOpen, alternativeClose] 21 char16_t mChars[4]; 22 }; 23 24 /** 25 * Return a pointer to the Quotes record for the given locale (lang attribute), 26 * or nullptr if none available. 27 * The returned value points to a hashtable entry, but will remain valid until 28 * shutdown begins, as the table is not modified after initialization. 29 */ 30 const Quotes* QuotesForLang(const nsAtom* aLang); 31 32 } // namespace intl 33 } // namespace mozilla 34 35 #endif // mozilla_intl_Quotes_h__ 36