Marek Sokolowski | 5cd3d5c | 2017-08-18 18:24:17 +0000 | [diff] [blame] | 1 | // |
| 2 | // The LLVM Compiler Infrastructure |
| 3 | // |
| 4 | // This file is distributed under the University of Illinois Open Source |
| 5 | // License. See LICENSE.TXT for details. |
| 6 | // |
| 7 | //===---------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This implements methods defined in ResourceScriptStmt.h. |
| 10 | // |
| 11 | // Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa380599(v=vs.85).aspx |
| 12 | // |
| 13 | //===---------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "ResourceScriptStmt.h" |
| 16 | |
| 17 | namespace llvm { |
| 18 | namespace rc { |
| 19 | |
| 20 | raw_ostream &operator<<(raw_ostream &OS, const IntOrString &Item) { |
| 21 | if (Item.IsInt) |
| 22 | return OS << Item.Data.Int; |
| 23 | else |
| 24 | return OS << Item.Data.String; |
| 25 | } |
| 26 | |
| 27 | raw_ostream &OptionalStmtList::log(raw_ostream &OS) const { |
| 28 | for (const auto &Stmt : Statements) { |
| 29 | OS << " Option: "; |
| 30 | Stmt->log(OS); |
| 31 | } |
| 32 | return OS; |
| 33 | } |
| 34 | |
| 35 | raw_ostream &LanguageResource::log(raw_ostream &OS) const { |
| 36 | return OS << "Language: " << Lang << ", Sublanguage: " << SubLang << "\n"; |
| 37 | } |
| 38 | |
Marek Sokolowski | 72aa937 | 2017-08-28 21:59:54 +0000 | [diff] [blame^] | 39 | raw_ostream &CursorResource::log(raw_ostream &OS) const { |
| 40 | return OS << "Cursor (" << ResName << "): " << CursorLoc << "\n"; |
| 41 | } |
| 42 | |
Marek Sokolowski | 5cd3d5c | 2017-08-18 18:24:17 +0000 | [diff] [blame] | 43 | raw_ostream &IconResource::log(raw_ostream &OS) const { |
| 44 | return OS << "Icon (" << ResName << "): " << IconLoc << "\n"; |
| 45 | } |
| 46 | |
Marek Sokolowski | 72aa937 | 2017-08-28 21:59:54 +0000 | [diff] [blame^] | 47 | raw_ostream &HTMLResource::log(raw_ostream &OS) const { |
| 48 | return OS << "HTML (" << ResName << "): " << HTMLLoc << "\n"; |
| 49 | } |
| 50 | |
Marek Sokolowski | 5cd3d5c | 2017-08-18 18:24:17 +0000 | [diff] [blame] | 51 | raw_ostream &StringTableResource::log(raw_ostream &OS) const { |
| 52 | OS << "StringTable:\n"; |
| 53 | OptStatements.log(OS); |
| 54 | for (const auto &String : Table) |
| 55 | OS << " " << String.first << " => " << String.second << "\n"; |
| 56 | return OS; |
| 57 | } |
| 58 | |
| 59 | raw_ostream &CharacteristicsStmt::log(raw_ostream &OS) const { |
| 60 | return OS << "Characteristics: " << Value << "\n"; |
| 61 | } |
| 62 | |
| 63 | raw_ostream &VersionStmt::log(raw_ostream &OS) const { |
| 64 | return OS << "Version: " << Value << "\n"; |
| 65 | } |
| 66 | |
| 67 | } // namespace rc |
| 68 | } // namespace llvm |