qrc

package module
Version: v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 14 Imported by: 0

README

qrc

Build Status PkgGoDev GitHub Tag

Go library and command-line tool to extract Qt resources from RCC files and executables.

This package supports resource formats 1-3 and includes language/country code information from Qt 5.13. Resources can be compressed using zlib or zstd.

See pkg.go.dev/github.com/pgaskin/qrc for the Go library documentation.

The command-line tool, qrc2zip, can be installed with GO111MODULE=on go get github.com/pgaskin/qrc/cmd/qrc2zip.

Usage: qrc2zip [options] rcc_file
       qrc2zip [options] executable format_version tree_offset data_offset names_offset

Options:
  -o, --output string         Output filename (default "resources.zip")
  -f, --force                 Ignore errors during extraction if possible
  -r, --recursive             Expand nested RCC files
  -e, --exclude stringArray   Exclude files matching this glob (can be specified multiple times)
  -v, --verbose               Show information about the files being extracted
  -h, --help                  Show this help text

Executable offsets:
  To find executable offsets and format version, look for calls to qRegisterResourceData. These
  are usually within entry points or qInitResource* functions. qRegisterResourceData takes four
  arguments: format, tree, names, data.

Qt support:
  Format versions 1-3 are supported, along with locale/country codes from Qt 5.13. Resources
  can be compressed with zlib or zstd.

Output:
  The extracted resources are written to a zip file. The directory structure is preserved and
  separated with forward slashes on all platforms. If the file has language/country constraints,
  they are added to the filename before the extension in the format '[language!LanguageName]'
  and [country!CountryName]. If the Qt resource format is >= 2, the modification time is also
  written for each file.

github.com/pgaskin/qrc

Documentation

Overview

Package qrc provides access to compiled Qt resource files in RCC files and application binaries.

This package supports resource formats 1-3 and includes language/country code information from Qt 5.13. Resources can be compressed using zlib or zstd.

Code generated by locale_generate.go from Qt 5.13. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var RCCHeaderMagic = [4]byte{'q', 'r', 'e', 's'}

RCCHeaderMagic identifies a RCC file.

Functions

This section is empty.

Types

type Country

type Country uint16

Country is a country supported by Qt (note: multiple names can have the same code).

const (
	CountryAfghanistan                            Country = 1
	CountryAlandIslands                           Country = 248
	CountryAlbania                                Country = 2
	CountryAlgeria                                Country = 3
	CountryAmericanSamoa                          Country = 4
	CountryAndorra                                Country = 5
	CountryAngola                                 Country = 6
	CountryAnguilla                               Country = 7
	CountryAntarctica                             Country = 8
	CountryAntiguaAndBarbuda                      Country = 9
	CountryAnyCountry                             Country = 0
	CountryArgentina                              Country = 10
	CountryArmenia                                Country = 11
	CountryAruba                                  Country = 12
	CountryAscensionIsland                        Country = 247
	CountryAustralia                              Country = 13
	CountryAustria                                Country = 14
	CountryAzerbaijan                             Country = 15
	CountryBahamas                                Country = 16
	CountryBahrain                                Country = 17
	CountryBangladesh                             Country = 18
	CountryBarbados                               Country = 19
	CountryBelarus                                Country = 20
	CountryBelgium                                Country = 21
	CountryBelize                                 Country = 22
	CountryBenin                                  Country = 23
	CountryBermuda                                Country = 24
	CountryBhutan                                 Country = 25
	CountryBolivia                                Country = 26
	CountryBonaire                                Country = 255
	CountryBosniaAndHerzegowina                   Country = 27
	CountryBotswana                               Country = 28
	CountryBouvetIsland                           Country = 29
	CountryBrazil                                 Country = 30
	CountryBritishIndianOceanTerritory            Country = 31
	CountryBritishVirginIslands                   Country = 233
	CountryBrunei                                 Country = 32
	CountryBulgaria                               Country = 33
	CountryBurkinaFaso                            Country = 34
	CountryBurundi                                Country = 35
	CountryCambodia                               Country = 36
	CountryCameroon                               Country = 37
	CountryCanada                                 Country = 38
	CountryCanaryIslands                          Country = 238
	CountryCapeVerde                              Country = 39
	CountryCaymanIslands                          Country = 40
	CountryCentralAfricanRepublic                 Country = 41
	CountryCeutaAndMelilla                        Country = 250
	CountryChad                                   Country = 42
	CountryChile                                  Country = 43
	CountryChina                                  Country = 44
	CountryChristmasIsland                        Country = 45
	CountryClippertonIsland                       Country = 241
	CountryCocosIslands                           Country = 46
	CountryColombia                               Country = 47
	CountryComoros                                Country = 48
	CountryCongoBrazzaville                       Country = 50
	CountryCongoKinshasa                          Country = 49
	CountryCookIslands                            Country = 51
	CountryCostaRica                              Country = 52
	CountryCroatia                                Country = 54
	CountryCuba                                   Country = 55
	CountryCuraSao                                Country = 152
	CountryCyprus                                 Country = 56
	CountryCzechRepublic                          Country = 57
	CountryDemocraticRepublicOfCongo              Country = CountryCongoKinshasa
	CountryDemocraticRepublicOfKorea              Country = CountryNorthKorea
	CountryDenmark                                Country = 58
	CountryDiegoGarcia                            Country = 249
	CountryDjibouti                               Country = 59
	CountryDominica                               Country = 60
	CountryDominicanRepublic                      Country = 61
	CountryEastTimor                              Country = 62
	CountryEcuador                                Country = 63
	CountryEgypt                                  Country = 64
	CountryElSalvador                             Country = 65
	CountryEquatorialGuinea                       Country = 66
	CountryEritrea                                Country = 67
	CountryEstonia                                Country = 68
	CountryEthiopia                               Country = 69
	CountryEurope                                 Country = 261
	CountryEuropeanUnion                          Country = 258
	CountryFalklandIslands                        Country = 70
	CountryFaroeIslands                           Country = 71
	CountryFiji                                   Country = 72
	CountryFinland                                Country = 73
	CountryFrance                                 Country = 74
	CountryFrenchGuiana                           Country = 76
	CountryFrenchPolynesia                        Country = 77
	CountryFrenchSouthernTerritories              Country = 78
	CountryGabon                                  Country = 79
	CountryGambia                                 Country = 80
	CountryGeorgia                                Country = 81
	CountryGermany                                Country = 82
	CountryGhana                                  Country = 83
	CountryGibraltar                              Country = 84
	CountryGreece                                 Country = 85
	CountryGreenland                              Country = 86
	CountryGrenada                                Country = 87
	CountryGuadeloupe                             Country = 88
	CountryGuam                                   Country = 89
	CountryGuatemala                              Country = 90
	CountryGuernsey                               Country = 75
	CountryGuinea                                 Country = 91
	CountryGuineaBissau                           Country = 92
	CountryGuyana                                 Country = 93
	CountryHaiti                                  Country = 94
	CountryHeardAndMcDonaldIslands                Country = 95
	CountryHonduras                               Country = 96
	CountryHongKong                               Country = 97
	CountryHungary                                Country = 98
	CountryIceland                                Country = 99
	CountryIndia                                  Country = 100
	CountryIndonesia                              Country = 101
	CountryIran                                   Country = 102
	CountryIraq                                   Country = 103
	CountryIreland                                Country = 104
	CountryIsleOfMan                              Country = 251
	CountryIsrael                                 Country = 105
	CountryItaly                                  Country = 106
	CountryIvoryCoast                             Country = 53
	CountryJamaica                                Country = 107
	CountryJapan                                  Country = 108
	CountryJersey                                 Country = 252
	CountryJordan                                 Country = 109
	CountryKazakhstan                             Country = 110
	CountryKenya                                  Country = 111
	CountryKiribati                               Country = 112
	CountryKosovo                                 Country = 257
	CountryKuwait                                 Country = 115
	CountryKyrgyzstan                             Country = 116
	CountryLaos                                   Country = 117
	CountryLastCountry                            Country = CountryEurope
	CountryLatinAmerica                           Country = 246
	CountryLatinAmericaAndTheCaribbean            Country = CountryLatinAmerica
	CountryLatvia                                 Country = 118
	CountryLebanon                                Country = 119
	CountryLesotho                                Country = 120
	CountryLiberia                                Country = 121
	CountryLibya                                  Country = 122
	CountryLiechtenstein                          Country = 123
	CountryLithuania                              Country = 124
	CountryLuxembourg                             Country = 125
	CountryMacau                                  Country = 126
	CountryMacedonia                              Country = 127
	CountryMadagascar                             Country = 128
	CountryMalawi                                 Country = 129
	CountryMalaysia                               Country = 130
	CountryMaldives                               Country = 131
	CountryMali                                   Country = 132
	CountryMalta                                  Country = 133
	CountryMarshallIslands                        Country = 134
	CountryMartinique                             Country = 135
	CountryMauritania                             Country = 136
	CountryMauritius                              Country = 137
	CountryMayotte                                Country = 138
	CountryMexico                                 Country = 139
	CountryMicronesia                             Country = 140
	CountryMoldova                                Country = 141
	CountryMonaco                                 Country = 142
	CountryMongolia                               Country = 143
	CountryMontenegro                             Country = 242
	CountryMontserrat                             Country = 144
	CountryMorocco                                Country = 145
	CountryMozambique                             Country = 146
	CountryMyanmar                                Country = 147
	CountryNamibia                                Country = 148
	CountryNauruCountry                           Country = 149
	CountryNepal                                  Country = 150
	CountryNetherlands                            Country = 151
	CountryNewCaledonia                           Country = 153
	CountryNewZealand                             Country = 154
	CountryNicaragua                              Country = 155
	CountryNiger                                  Country = 156
	CountryNigeria                                Country = 157
	CountryNiue                                   Country = 158
	CountryNorfolkIsland                          Country = 159
	CountryNorthKorea                             Country = 113
	CountryNorthernMarianaIslands                 Country = 160
	CountryNorway                                 Country = 161
	CountryOman                                   Country = 162
	CountryOutlyingOceania                        Country = 259
	CountryPakistan                               Country = 163
	CountryPalau                                  Country = 164
	CountryPalestinianTerritories                 Country = 165
	CountryPanama                                 Country = 166
	CountryPapuaNewGuinea                         Country = 167
	CountryParaguay                               Country = 168
	CountryPeoplesRepublicOfCongo                 Country = CountryCongoBrazzaville
	CountryPeru                                   Country = 169
	CountryPhilippines                            Country = 170
	CountryPitcairn                               Country = 171
	CountryPoland                                 Country = 172
	CountryPortugal                               Country = 173
	CountryPuertoRico                             Country = 174
	CountryQatar                                  Country = 175
	CountryRepublicOfKorea                        Country = CountrySouthKorea
	CountryReunion                                Country = 176
	CountryRomania                                Country = 177
	CountryRussia                                 Country = 178
	CountryRussianFederation                      Country = CountryRussia
	CountryRwanda                                 Country = 179
	CountrySaintBarthelemy                        Country = 244
	CountrySaintHelena                            Country = 199
	CountrySaintKittsAndNevis                     Country = 180
	CountrySaintLucia                             Country = 181
	CountrySaintMartin                            Country = 245
	CountrySaintPierreAndMiquelon                 Country = 200
	CountrySaintVincentAndTheGrenadines           Country = 182
	CountrySamoa                                  Country = 183
	CountrySanMarino                              Country = 184
	CountrySaoTomeAndPrincipe                     Country = 185
	CountrySaudiArabia                            Country = 186
	CountrySenegal                                Country = 187
	CountrySerbia                                 Country = 243
	CountrySeychelles                             Country = 188
	CountrySierraLeone                            Country = 189
	CountrySingapore                              Country = 190
	CountrySintMaarten                            Country = 256
	CountrySlovakia                               Country = 191
	CountrySlovenia                               Country = 192
	CountrySolomonIslands                         Country = 193
	CountrySomalia                                Country = 194
	CountrySouthAfrica                            Country = 195
	CountrySouthGeorgiaAndTheSouthSandwichIslands Country = 196
	CountrySouthKorea                             Country = 114
	CountrySouthSudan                             Country = 254
	CountrySpain                                  Country = 197
	CountrySriLanka                               Country = 198
	CountrySudan                                  Country = 201
	CountrySuriname                               Country = 202
	CountrySvalbardAndJanMayenIslands             Country = 203
	CountrySwaziland                              Country = 204
	CountrySweden                                 Country = 205
	CountrySwitzerland                            Country = 206
	CountrySyria                                  Country = 207
	CountrySyrianArabRepublic                     Country = CountrySyria
	CountryTaiwan                                 Country = 208
	CountryTajikistan                             Country = 209
	CountryTanzania                               Country = 210
	CountryThailand                               Country = 211
	CountryTogo                                   Country = 212
	CountryTokelau                                Country = CountryTokelauCountry
	CountryTokelauCountry                         Country = 213
	CountryTonga                                  Country = 214
	CountryTrinidadAndTobago                      Country = 215
	CountryTristanDaCunha                         Country = 253
	CountryTunisia                                Country = 216
	CountryTurkey                                 Country = 217
	CountryTurkmenistan                           Country = 218
	CountryTurksAndCaicosIslands                  Country = 219
	CountryTuvalu                                 Country = CountryTuvaluCountry
	CountryTuvaluCountry                          Country = 220
	CountryUganda                                 Country = 221
	CountryUkraine                                Country = 222
	CountryUnitedArabEmirates                     Country = 223
	CountryUnitedKingdom                          Country = 224
	CountryUnitedStates                           Country = 225
	CountryUnitedStatesMinorOutlyingIslands       Country = 226
	CountryUnitedStatesVirginIslands              Country = 234
	CountryUruguay                                Country = 227
	CountryUzbekistan                             Country = 228
	CountryVanuatu                                Country = 229
	CountryVaticanCityState                       Country = 230
	CountryVenezuela                              Country = 231
	CountryVietnam                                Country = 232
	CountryWallisAndFutunaIslands                 Country = 235
	CountryWesternSahara                          Country = 236
	CountryWorld                                  Country = 260
	CountryYemen                                  Country = 237
	CountryZambia                                 Country = 239
	CountryZimbabwe                               Country = 240
)

func (Country) String

func (c Country) String() string

type Language

type Language uint16

Language is a language supported by Qt (note: multiple names can have the same code).

const (
	LanguageAbkhazian                 Language = 2
	LanguageAfan                      Language = LanguageOromo
	LanguageAfar                      Language = 4
	LanguageAfrikaans                 Language = 5
	LanguageAghem                     Language = 237
	LanguageAhom                      Language = 340
	LanguageAkan                      Language = 146
	LanguageAkkadian                  Language = 262
	LanguageAkoose                    Language = 312
	LanguageAlbanian                  Language = 6
	LanguageAmericanSignLanguage      Language = 341
	LanguageAmharic                   Language = 7
	LanguageAncientEgyptian           Language = 263
	LanguageAncientGreek              Language = 264
	LanguageAncientNorthArabian       Language = 331
	LanguageAnyLanguage               Language = 0
	LanguageArabic                    Language = 8
	LanguageAragonese                 Language = 261
	LanguageAramaic                   Language = 265
	LanguageArdhamagadhiPrakrit       Language = 342
	LanguageArmenian                  Language = 9
	LanguageAssamese                  Language = 10
	LanguageAsturian                  Language = 256
	LanguageAsu                       Language = 205
	LanguageAtsam                     Language = 156
	LanguageAvaric                    Language = 216
	LanguageAvestan                   Language = 255
	LanguageAymara                    Language = 11
	LanguageAzerbaijani               Language = 12
	LanguageBafia                     Language = 243
	LanguageBalinese                  Language = 266
	LanguageBambara                   Language = 188
	LanguageBamun                     Language = 267
	LanguageBasaa                     Language = 238
	LanguageBashkir                   Language = 13
	LanguageBasque                    Language = 14
	LanguageBassa                     Language = 336
	LanguageBatakToba                 Language = 268
	LanguageBelarusian                Language = 22
	LanguageBemba                     Language = 195
	LanguageBena                      Language = 186
	LanguageBengali                   Language = 15
	LanguageBhojpuri                  Language = 343
	LanguageBhutani                   Language = LanguageDzongkha
	LanguageBihari                    Language = 17
	LanguageBislama                   Language = 18
	LanguageBlin                      Language = 152
	LanguageBodo                      Language = 215
	LanguageBosnian                   Language = 142
	LanguageBreton                    Language = 19
	LanguageBuginese                  Language = 269
	LanguageBuhid                     Language = 270
	LanguageBulgarian                 Language = 20
	LanguageBurmese                   Language = 21
	LanguageByelorussian              Language = LanguageBelarusian
	LanguageC                         Language = 1
	LanguageCambodian                 Language = LanguageKhmer
	LanguageCantonese                 Language = 357
	LanguageCarian                    Language = 271
	LanguageCatalan                   Language = 24
	LanguageCentralKurdish            Language = 316
	LanguageCentralMoroccoTamazight   Language = 212
	LanguageChakma                    Language = 272
	LanguageChamorro                  Language = 217
	LanguageChechen                   Language = 218
	LanguageCherokee                  Language = 190
	LanguageChewa                     Language = LanguageNyanja
	LanguageChiga                     Language = 211
	LanguageChinese                   Language = 25
	LanguageChurch                    Language = 219
	LanguageChuvash                   Language = 220
	LanguageClassicalMandaic          Language = 273
	LanguageColognian                 Language = 201
	LanguageCongoSwahili              Language = 250
	LanguageCoptic                    Language = 274
	LanguageCornish                   Language = 145
	LanguageCorsican                  Language = 26
	LanguageCree                      Language = 221
	LanguageCroatian                  Language = 27
	LanguageCzech                     Language = 28
	LanguageDanish                    Language = 29
	LanguageDivehi                    Language = 143
	LanguageDogri                     Language = 275
	LanguageDuala                     Language = 240
	LanguageDutch                     Language = 30
	LanguageDzongkha                  Language = 16
	LanguageEasternCham               Language = 276
	LanguageEasternKayah              Language = 277
	LanguageEmbu                      Language = 189
	LanguageEnglish                   Language = 31
	LanguageEsperanto                 Language = 32
	LanguageEstonian                  Language = 33
	LanguageEtruscan                  Language = 278
	LanguageEwe                       Language = 161
	LanguageEwondo                    Language = 242
	LanguageFaroese                   Language = 34
	LanguageFijian                    Language = 35
	LanguageFilipino                  Language = 166
	LanguageFinnish                   Language = 36
	LanguageFrench                    Language = 37
	LanguageFrisian                   Language = LanguageWesternFrisian
	LanguageFriulian                  Language = 159
	LanguageFulah                     Language = 177
	LanguageGa                        Language = 148
	LanguageGaelic                    Language = 39
	LanguageGalician                  Language = 40
	LanguageGanda                     Language = 194
	LanguageGeez                      Language = 153
	LanguageGeorgian                  Language = 41
	LanguageGerman                    Language = 42
	LanguageGothic                    Language = 279
	LanguageGreek                     Language = 43
	LanguageGreenlandic               Language = 44
	LanguageGuarani                   Language = 45
	LanguageGujarati                  Language = 46
	LanguageGusii                     Language = 175
	LanguageHaitian                   Language = 222
	LanguageHanunoo                   Language = 280
	LanguageHausa                     Language = 47
	LanguageHawaiian                  Language = 163
	LanguageHebrew                    Language = 48
	LanguageHerero                    Language = 223
	LanguageHieroglyphicLuwian        Language = 344
	LanguageHindi                     Language = 49
	LanguageHiriMotu                  Language = 224
	LanguageHmongNjua                 Language = 333
	LanguageHo                        Language = 334
	LanguageHungarian                 Language = 50
	LanguageIcelandic                 Language = 51
	LanguageIdo                       Language = 360
	LanguageIgbo                      Language = 149
	LanguageInariSami                 Language = 326
	LanguageIndonesian                Language = 52
	LanguageIngush                    Language = 281
	LanguageInterlingua               Language = 53
	LanguageInterlingue               Language = 54
	LanguageInuktitut                 Language = 55
	LanguageInupiak                   Language = 56
	LanguageIrish                     Language = 57
	LanguageItalian                   Language = 58
	LanguageJapanese                  Language = 59
	LanguageJavanese                  Language = 60
	LanguageJju                       Language = 158
	LanguageJolaFonyi                 Language = 241
	LanguageKabuverdianu              Language = 196
	LanguageKabyle                    Language = 184
	LanguageKako                      Language = 258
	LanguageKalenjin                  Language = 198
	LanguageKamba                     Language = 150
	LanguageKannada                   Language = 61
	LanguageKanuri                    Language = 225
	LanguageKashmiri                  Language = 62
	LanguageKazakh                    Language = 63
	LanguageKenyang                   Language = 319
	LanguageKhmer                     Language = 23
	LanguageKiche                     Language = 323
	LanguageKikuyu                    Language = 178
	LanguageKinyarwanda               Language = 64
	LanguageKirghiz                   Language = 65
	LanguageKomi                      Language = 226
	LanguageKongo                     Language = 227
	LanguageKonkani                   Language = 147
	LanguageKorean                    Language = 66
	LanguageKoro                      Language = 154
	LanguageKoyraChiini               Language = 208
	LanguageKoyraboroSenni            Language = 213
	LanguageKpelle                    Language = 169
	LanguageKurdish                   Language = 67
	LanguageKurundi                   Language = LanguageRundi
	LanguageKwanyama                  Language = 228
	LanguageKwasio                    Language = 246
	LanguageLakota                    Language = 313
	LanguageLangi                     Language = 193
	LanguageLao                       Language = 69
	LanguageLargeFloweryMiao          Language = 282
	LanguageLastLanguage              Language = LanguageWesternBalochi
	LanguageLatin                     Language = 70
	LanguageLatvian                   Language = 71
	LanguageLepcha                    Language = 283
	LanguageLezghian                  Language = 335
	LanguageLimbu                     Language = 284
	LanguageLimburgish                Language = 229
	LanguageLinearA                   Language = 332
	LanguageLingala                   Language = 72
	LanguageLisu                      Language = 285
	LanguageLiteraryChinese           Language = 345
	LanguageLithuanian                Language = 73
	LanguageLojban                    Language = 361
	LanguageLowGerman                 Language = 170
	LanguageLowerSorbian              Language = 317
	LanguageLu                        Language = 286
	LanguageLubaKatanga               Language = 230
	LanguageLuleSami                  Language = 325
	LanguageLuo                       Language = 210
	LanguageLuxembourgish             Language = 231
	LanguageLuyia                     Language = 204
	LanguageLycian                    Language = 287
	LanguageLydian                    Language = 288
	LanguageMacedonian                Language = 74
	LanguageMachame                   Language = 200
	LanguageMaithili                  Language = 339
	LanguageMakhuwaMeetto             Language = 244
	LanguageMakonde                   Language = 192
	LanguageMalagasy                  Language = 75
	LanguageMalay                     Language = 76
	LanguageMalayalam                 Language = 77
	LanguageMaltese                   Language = 78
	LanguageMandingo                  Language = 289
	LanguageManichaeanMiddlePersian   Language = 329
	LanguageManipuri                  Language = 290
	LanguageManx                      Language = 144
	LanguageMaori                     Language = 79
	LanguageMapuche                   Language = 315
	LanguageMarathi                   Language = 80
	LanguageMarshallese               Language = 81
	LanguageMasai                     Language = 202
	LanguageMazanderani               Language = 346
	LanguageMende                     Language = 330
	LanguageMeroitic                  Language = 291
	LanguageMeru                      Language = 197
	LanguageMeta                      Language = 259
	LanguageMohawk                    Language = 320
	LanguageMoldavian                 Language = LanguageRomanian
	LanguageMongolian                 Language = 82
	LanguageMono                      Language = 337
	LanguageMorisyen                  Language = 191
	LanguageMru                       Language = 347
	LanguageMundang                   Language = 245
	LanguageNama                      Language = 199
	LanguageNauruLanguage             Language = 83
	LanguageNavaho                    Language = 232
	LanguageNdonga                    Language = 233
	LanguageNepali                    Language = 84
	LanguageNewari                    Language = 348
	LanguageNgiemboon                 Language = 260
	LanguageNgomba                    Language = 257
	LanguageNko                       Language = 321
	LanguageNorthNdebele              Language = 181
	LanguageNorthernLuri              Language = 349
	LanguageNorthernSami              Language = 173
	LanguageNorthernSotho             Language = 172
	LanguageNorthernThai              Language = 292
	LanguageNorwegian                 Language = LanguageNorwegianBokmal
	LanguageNorwegianBokmal           Language = 85
	LanguageNorwegianNynorsk          Language = 141
	LanguageNuer                      Language = 247
	LanguageNyanja                    Language = 165
	LanguageNyankole                  Language = 185
	LanguageOccitan                   Language = 86
	LanguageOjibwa                    Language = 234
	LanguageOldIrish                  Language = 293
	LanguageOldNorse                  Language = 294
	LanguageOldPersian                Language = 295
	LanguageOldTurkish                Language = 296
	LanguageOriya                     Language = 87
	LanguageOromo                     Language = 3
	LanguageOsage                     Language = 358
	LanguageOssetic                   Language = 101
	LanguagePahlavi                   Language = 297
	LanguagePalauan                   Language = 350
	LanguagePali                      Language = 235
	LanguagePapiamento                Language = 351
	LanguageParthian                  Language = 298
	LanguagePashto                    Language = 88
	LanguagePersian                   Language = 89
	LanguagePhoenician                Language = 299
	LanguagePolish                    Language = 90
	LanguagePortuguese                Language = 91
	LanguagePrakritLanguage           Language = 300
	LanguagePrussian                  Language = 322
	LanguagePunjabi                   Language = 92
	LanguageQuechua                   Language = 93
	LanguageRejang                    Language = 301
	LanguageRhaetoRomance             Language = LanguageRomansh
	LanguageRomanian                  Language = 95
	LanguageRomansh                   Language = 94
	LanguageRombo                     Language = 182
	LanguageRundi                     Language = 68
	LanguageRussian                   Language = 96
	LanguageRwa                       Language = 209
	LanguageSabaean                   Language = 302
	LanguageSaho                      Language = 207
	LanguageSakha                     Language = 248
	LanguageSamaritan                 Language = 303
	LanguageSamburu                   Language = 179
	LanguageSamoan                    Language = 97
	LanguageSango                     Language = 98
	LanguageSangu                     Language = 249
	LanguageSanskrit                  Language = 99
	LanguageSantali                   Language = 304
	LanguageSaraiki                   Language = 352
	LanguageSardinian                 Language = 115
	LanguageSaurashtra                Language = 305
	LanguageSena                      Language = 180
	LanguageSerbian                   Language = 100
	LanguageSerboCroatian             Language = LanguageSerbian
	LanguageShambala                  Language = 214
	LanguageShona                     Language = 104
	LanguageSichuanYi                 Language = 168
	LanguageSicilian                  Language = 362
	LanguageSidamo                    Language = 155
	LanguageSindhi                    Language = 105
	LanguageSinhala                   Language = 106
	LanguageSkoltSami                 Language = 327
	LanguageSlovak                    Language = 108
	LanguageSlovenian                 Language = 109
	LanguageSoga                      Language = 203
	LanguageSomali                    Language = 110
	LanguageSora                      Language = 306
	LanguageSouthNdebele              Language = 171
	LanguageSouthernKurdish           Language = 363
	LanguageSouthernSami              Language = 324
	LanguageSouthernSotho             Language = 102
	LanguageSpanish                   Language = 111
	LanguageStandardMoroccanTamazight Language = 314
	LanguageSundanese                 Language = 112
	LanguageSwahili                   Language = 113
	LanguageSwati                     Language = 107
	LanguageSwedish                   Language = 114
	LanguageSwissGerman               Language = 167
	LanguageSylheti                   Language = 307
	LanguageSyriac                    Language = 151
	LanguageTachelhit                 Language = 183
	LanguageTagalog                   Language = LanguageFilipino
	LanguageTagbanwa                  Language = 308
	LanguageTahitian                  Language = 127
	LanguageTaiDam                    Language = 309
	LanguageTaiNua                    Language = 310
	LanguageTaita                     Language = 176
	LanguageTajik                     Language = 116
	LanguageTamil                     Language = 117
	LanguageTangut                    Language = 359
	LanguageTaroko                    Language = 174
	LanguageTasawaq                   Language = 251
	LanguageTatar                     Language = 118
	LanguageTedimChin                 Language = 338
	LanguageTelugu                    Language = 119
	LanguageTeso                      Language = 206
	LanguageThai                      Language = 120
	LanguageTibetan                   Language = 121
	LanguageTigre                     Language = 157
	LanguageTigrinya                  Language = 122
	LanguageTokPisin                  Language = 354
	LanguageTokelauLanguage           Language = 353
	LanguageTongan                    Language = 123
	LanguageTsonga                    Language = 124
	LanguageTswana                    Language = 103
	LanguageTurkish                   Language = 125
	LanguageTurkmen                   Language = 126
	LanguageTuvaluLanguage            Language = 355
	LanguageTwi                       Language = LanguageAkan
	LanguageTyap                      Language = 164
	LanguageUgaritic                  Language = 311
	LanguageUighur                    Language = 128
	LanguageUigur                     Language = LanguageUighur
	LanguageUkrainian                 Language = 129
	LanguageUncodedLanguages          Language = 356
	LanguageUpperSorbian              Language = 318
	LanguageUrdu                      Language = 130
	LanguageUzbek                     Language = 131
	LanguageVai                       Language = 252
	LanguageVenda                     Language = 160
	LanguageVietnamese                Language = 132
	LanguageVolapuk                   Language = 133
	LanguageVunjo                     Language = 187
	LanguageWalamo                    Language = 162
	LanguageWalloon                   Language = 236
	LanguageWalser                    Language = 253
	LanguageWarlpiri                  Language = 328
	LanguageWelsh                     Language = 134
	LanguageWesternBalochi            Language = 364
	LanguageWesternFrisian            Language = 38
	LanguageWolof                     Language = 135
	LanguageXhosa                     Language = 136
	LanguageYangben                   Language = 254
	LanguageYiddish                   Language = 137
	LanguageYoruba                    Language = 138
	LanguageZarma                     Language = 239
	LanguageZhuang                    Language = 139
	LanguageZulu                      Language = 140
)

func (Language) String

func (l Language) String() string

type Node

type Node struct {
	NameOffset uint32
	Flags      NodeFlag

	// if dir
	ChildCount  uint32
	ChildOffset uint32

	// if not dir
	Country    Country
	Language   Language
	DataOffset uint32

	// format >= 2
	Modified uint64

	Format int // not an actual field, but used while parsing
}

Node represents a Qt resource tree node.

func ParseNode

func ParseNode(r io.Reader, format int) (*Node, error)

ParseNode reads a Qt resource tree node from the provided reader. If an error occurs, any number of bytes may have been read from the reader.

func (Node) Children

func (n Node) Children(tree io.ReaderAt) ([]*Node, error)

Children gets the children of the tree node. If it is not a directory, an error is returned.

func (Node) Data

func (n Node) Data(data io.ReaderAt) (rc io.ReadCloser, fileOff int64, fileSz int64, err error)

Data opens a reader for the original content of the file, and also returns the offset/size (relative to the data reader) of the corresponding data in the resource (this may be smaller than the file contents if the data was compressed). If the entry is a directory, an error is returned.

func (Node) IsDir

func (n Node) IsDir() bool

IsDir returns true if the tree node represents a directory.

func (Node) ModTime

func (n Node) ModTime() time.Time

ModTime returns the file modification time for format version >= 2. On older versions, a zero time is returned.

func (Node) Name

func (n Node) Name(names io.ReaderAt) (string, error)

Name reads the name of the file.

type NodeFlag

type NodeFlag uint16

NodeFlag is a flag for a Node. Multiple flags can be ORd together.

const (
	NodeFlagNone           NodeFlag = 0
	NodeFlagCompressed     NodeFlag = 1
	NodeFlagDirectory      NodeFlag = 2
	NodeFlagCompressedZstd NodeFlag = 4
)

func (NodeFlag) Has

func (f NodeFlag) Has(v NodeFlag) bool

Has returns true if the provided flag bits are set.

func (NodeFlag) String

func (f NodeFlag) String() string

func (NodeFlag) Valid

func (f NodeFlag) Valid() error

Valid checks if the combination of flags are valid. It does not check the format version.

type RCCHeader

type RCCHeader struct {
	Magic         [4]byte
	FormatVersion int32
	TreeOffset    int32
	DataOffset    int32
	NamesOffset   int32

	// FormatVersion >= 3
	OverallFlags int32
}

RCCHeader is the header of a Qt resource file in the binary format. Note that the offsets are relative to the start of the file (i.e. the start of the header).

func ParseRCCHeader

func ParseRCCHeader(r io.Reader) (*RCCHeader, error)

ParseRCCHeader parses the RCC header. If the magic bytes are invalid, an error is returned. If an error occurs, any number of bytes may have been read from the reader.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a high-level reader for compiled Qt resources. It is thread-safe if the underlying reader is.

func NewReader

func NewReader(r io.ReaderAt, formatVersion int, treeOffset, dataOffset, namesOffset int64) (*Reader, error)

NewReader initializes a reader with the provided version and offsets.

func NewReaderFromRCC

func NewReaderFromRCC(r io.ReaderAt) (*Reader, error)

NewReaderFromRCC initializes a reader for the provided RCC file.

func (*Reader) Children

func (r *Reader) Children() ([]*ReaderEntry, error)

Children returns the top-level files in the resource root.

func (*Reader) Walk

func (r *Reader) Walk(fn WalkFunc, rccRecurse bool) error

Walk calls the provided WalkFunc for each entry in the tree, similarly to filepath.Walk (including filepath.SkipDir). If rccRecurse is true, nested RCC files are opened and treated as a directory.

type ReaderEntry

type ReaderEntry struct {
	// contains filtered or unexported fields
}

ReaderEntry is an entry read by a Reader.

func (ReaderEntry) Children

func (e ReaderEntry) Children() ([]*ReaderEntry, error)

Children reads and returns the child entries. If the entry is not a directory, an error is returned.

func (ReaderEntry) Constraints

func (e ReaderEntry) Constraints() (Country, Language)

Constraints returns the country/language constraints for the file. A directory can contain multiple files with the same name, but different constraints.

func (ReaderEntry) Flags

func (e ReaderEntry) Flags() NodeFlag

Flags returns the flags set on the underlying node.

func (ReaderEntry) IsDir

func (e ReaderEntry) IsDir() bool

IsDir returns true if the entry represents a directory.

func (ReaderEntry) ModTime

func (e ReaderEntry) ModTime() time.Time

ModTime returns the modification time of the entry. On format versions < 2, a zero time is always returned.

func (ReaderEntry) Name

func (e ReaderEntry) Name() string

Name returns the name of the entry.

func (ReaderEntry) Offset added in v0.0.2

func (e ReaderEntry) Offset() int64

Offset returns the real offset of the entry's contents relative to the base io.ReaderAt used when creating the Reader. If the entry is a directory, the offset points to the first child's tree node. If the entry is a file, the offset points to the first byte of data (immediately after the uint32 size header, plus the 4-byte qCompress zlib header if the node has the NodeFlagCompressed flag).

func (ReaderEntry) Open

func (e ReaderEntry) Open() (io.ReadCloser, error)

Open opens a reader for the contents of the entry. If the entry is a directory, an error is returned.

func (ReaderEntry) Size added in v0.0.2

func (e ReaderEntry) Size() (int64, error)

Size returns the real (i.e. as-is, possibly compressed) size of the underlying data relative to the base io.ReaderAt used when creating the Reader. If the entry is a directory, the size is the total of all child tree nodes (i.e. Offset() + Size() = end of last child). If the entry is a file, the size is the size of the underlying data in the file. To get the uncompressed size, Open() the entry and count the number of bytes read.

type WalkFunc

type WalkFunc func(path string, entry *ReaderEntry, err error) error

WalkFunc is the same as filepath.WalkFunc. The path is always separated with forward slashes and does not have a leading dot. In addition, filepath.SkipDir will also prevent recursion into embedded RCC files if present.

Directories

Path Synopsis
cmd
qrc2zip
Command qrc2zip extracts compiled Qt resources into a zip file.
Command qrc2zip extracts compiled Qt resources into a zip file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL