Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #ifndef OTS_NAME_H_ |
michael@0 | 6 | #define OTS_NAME_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <new> |
michael@0 | 9 | #include <string> |
michael@0 | 10 | #include <utility> |
michael@0 | 11 | #include <vector> |
michael@0 | 12 | |
michael@0 | 13 | #include "ots.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace ots { |
michael@0 | 16 | |
michael@0 | 17 | struct NameRecord { |
michael@0 | 18 | NameRecord() { |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | NameRecord(uint16_t platformID, uint16_t encodingID, |
michael@0 | 22 | uint16_t languageID, uint16_t nameID) |
michael@0 | 23 | : platform_id(platformID), |
michael@0 | 24 | encoding_id(encodingID), |
michael@0 | 25 | language_id(languageID), |
michael@0 | 26 | name_id(nameID) { |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | uint16_t platform_id; |
michael@0 | 30 | uint16_t encoding_id; |
michael@0 | 31 | uint16_t language_id; |
michael@0 | 32 | uint16_t name_id; |
michael@0 | 33 | std::string text; |
michael@0 | 34 | |
michael@0 | 35 | bool operator<(const NameRecord& rhs) const { |
michael@0 | 36 | if (platform_id < rhs.platform_id) return true; |
michael@0 | 37 | if (platform_id > rhs.platform_id) return false; |
michael@0 | 38 | if (encoding_id < rhs.encoding_id) return true; |
michael@0 | 39 | if (encoding_id > rhs.encoding_id) return false; |
michael@0 | 40 | if (language_id < rhs.language_id) return true; |
michael@0 | 41 | if (language_id > rhs.language_id) return false; |
michael@0 | 42 | return name_id < rhs.name_id; |
michael@0 | 43 | } |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | struct OpenTypeNAME { |
michael@0 | 47 | std::vector<NameRecord> names; |
michael@0 | 48 | std::vector<std::string> lang_tags; |
michael@0 | 49 | }; |
michael@0 | 50 | |
michael@0 | 51 | } // namespace ots |
michael@0 | 52 | |
michael@0 | 53 | #endif // OTS_NAME_H_ |