PGE File library class of static functions. Library is buildable in both Qt and STL applications. More...
#include <file_formats.h>
Public Types | |
| enum | ErrorCodes { Success =0, ERROR_NotExist, ERROR_AccessDenied, ERROR_InvalidSyntax, ERROR_PGEX_SectionNotClosed, ERROR_PGEX_InvalidSyntax, ERROR_PGEX_InvalidDataType } |
| File parse error codes. More... | |
| enum | SMBX64_violations { SMBX64_FINE = 0x000, SMBX64EXC_SECTIONS = 0x001, SMBX64EXC_BLOCKS = 0x002, SMBX64EXC_BGOS = 0x004, SMBX64EXC_NPCS = 0x008, SMBX64EXC_WATERBOXES = 0x010, SMBX64EXC_WARPS = 0x020, SMBX64EXC_LAYERS = 0x040, SMBX64EXC_EVENTS = 0x080, SMBX64EXC_TILES = 0x100, SMBX64EXC_SCENERIES = 0x200, SMBX64EXC_PATHS = 0x400, SMBX64EXC_LEVELS = 0x800, SMBX64EXC_MUSICBOXES = 0x1000 } |
| SMBX64 Standrd specific violation codes. More... | |
Static Public Member Functions | |
| static MetaData | ReadNonSMBX64MetaData (PGESTRING RawData) |
| Parses non-SMBX64 meta-data from additional *.meta files there are contains data which impossible to save into SMBX64 LVL file therefore it will be saved into additional *.meta file. More... | |
| static PGESTRING | WriteNonSMBX64MetaData (MetaData metaData) |
| Generates raw data of non-SMBX meta-data file from Meta-data structure. More... | |
| static LevelData | OpenLevelFile (PGESTRING filePath) |
| Parses a level file with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX) More... | |
| static LevelData | OpenLevelFileHeader (PGESTRING filePath) |
| Parses a level file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX) More... | |
| static LevelData | ReadSMBX64LvlFileHeader (PGESTRING filePath) |
| Parses SMBX1...64 level file header and skips other part of a file. More... | |
| static LevelData | ReadSMBX64LvlFile (PGESTRING RawData, PGESTRING filePath="") |
| Parses SMBX1...64 level file data. More... | |
| static PGESTRING | WriteSMBX64LvlFile (LevelData FileData, int file_format=64) |
| Generates SMBX1...64 Level file data. More... | |
| static LevelData | ReadExtendedLvlFileHeader (PGESTRING filePath) |
| Parses PGE-X Level file header. More... | |
| static LevelData | ReadExtendedLvlFile (PGESTRING RawData, PGESTRING filePath="") |
| Parses PGE-X level file data. More... | |
| static PGESTRING | WriteExtendedLvlFile (LevelData FileData) |
| Generates PGE-X Level file. More... | |
| static LevelData | CreateLevelData () |
| Generates blank initialized level data structure. More... | |
| static LevelNPC | CreateLvlNpc () |
| Initializes Level specific NPC entry structure with default properties. More... | |
| static LevelDoor | CreateLvlWarp () |
| Initializes Level specific Warp entry structure with default properties. More... | |
| static LevelBlock | CreateLvlBlock () |
| Initializes Level specific Block entry structure with default properties. More... | |
| static LevelBGO | CreateLvlBgo () |
| Initializes Level specific Background Object entry structure with default properties. More... | |
| static LevelPhysEnv | CreateLvlPhysEnv () |
| Initializes Level specific Physical Environment Zone entry structure with default properties. More... | |
| static LevelLayer | CreateLvlLayer () |
| Initializes Level specific Layer entry structure with default properties. More... | |
| static LevelSMBX64Event | CreateLvlEvent () |
| Initializes Level specific SMBX64 Event entry structure with default properties. More... | |
| static PlayerPoint | CreateLvlPlayerPoint (int id=0) |
| Initializes Level specific Player spawn point entry structure with default properties. More... | |
| static LevelSection | CreateLvlSection () |
| Initializes Level specific Section Settings entry structure with default properties. More... | |
| static void | smbx64LevelPrepare (LevelData &lvl) |
| Optimizing level data for SMBX64 Standard requirements. More... | |
| static void | smbx64LevelSortBlocks (LevelData &lvl) |
| Sorts blocks array by Y->X positions in the given level data structure. By SMBX64 standard, blocks array must be sorted because it is required for NPC's collision detection algorithm of SMBX Engine. More... | |
| static void | smbx64LevelSortBGOs (LevelData &lvl) |
| Sorts Background objects by special order priority value Modifying of order priority values allowing to force specific non-foreground BGO's to be rendered foreground. More... | |
| static WorldData | OpenWorldFile (PGESTRING filePath) |
| Parses a world map file with auto-detection of a file type (SMBX1...64 LVL or PGE-WLDX) More... | |
| static WorldData | OpenWorldFileHeader (PGESTRING filePath) |
| Parses a world map file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-WLDX) More... | |
| static WorldData | ReadSMBX64WldFileHeader (PGESTRING filePath) |
| Parsed SMBX1...64 World map file header only. More... | |
| static WorldData | ReadSMBX64WldFile (PGESTRING RawData, PGESTRING filePath) |
| Parses SMBX1...64 World map file from raw data. More... | |
| static PGESTRING | WriteSMBX64WldFile (WorldData FileData, int file_format=64) |
| Generates raw data string in SMBX1...64 World map format. More... | |
| static WorldData | ReadExtendedWldFileHeader (PGESTRING filePath) |
| Parsed PGE-X World map file header only. More... | |
| static WorldData | ReadExtendedWldFile (PGESTRING RawData, PGESTRING filePath) |
| Parses PGE-X World map file from raw data. More... | |
| static PGESTRING | WriteExtendedWldFile (WorldData FileData) |
| Generates raw data string in PGE-X World map format. More... | |
| static WorldData | CreateWorldData () |
| Generates blank initialized World map data structure. More... | |
| static WorldTiles | CreateWldTile () |
| Initializes World map specific Tile entry structure with default properties. More... | |
| static WorldScenery | CreateWldScenery () |
| Initializes World map specific Scenery entry structure with default properties. More... | |
| static WorldPaths | CreateWldPath () |
| Initializes World map specific Path entry structure with default properties. More... | |
| static WorldLevels | CreateWldLevel () |
| Initializes World map specific Level Entrance point entry structure with default properties. More... | |
| static WorldMusic | CreateWldMusicbox () |
| Initializes World map specific Music Box entry structure with default properties. More... | |
| static GamesaveData | ReadSMBX64SavFile (PGESTRING RawData, PGESTRING filePath) |
| Parses SMBX1...64 Game save file from raw data string. More... | |
| static GamesaveData | ReadExtendedSaveFile (PGESTRING RawData, PGESTRING filePath) |
| Parses PGE-X Game save file from raw data string. More... | |
| static PGESTRING | WriteExtendedSaveFile (GamesaveData &FileData) |
| Generate raw data in PGE-X Game save file from GameSave data structure. More... | |
| static GamesaveData | CreateGameSaveData () |
| Initializes blank game save data structure with default preferences. More... | |
| static saveCharState | CreateSavCharacterState () |
| Inirializes Game Save specific playable character state entry. More... | |
| static SMBX64_ConfigFile | ReadSMBX64ConfigFile (PGESTRING RawData) |
| Parses SMBX Engine config file raw data string. More... | |
| static PGESTRING | WriteSMBX64ConfigFile (SMBX64_ConfigFile &FileData, int file_format) |
| Generates SMBX Engine specific config file raw data string. More... | |
| static NPCConfigFile | ReadNpcTXTFile (PGESTRING file, bool IgnoreBad=false) |
| Parses SMBX64 NPC.txt file. More... | |
| static PGESTRING | WriteNPCTxtFile (NPCConfigFile FileData) |
| Generates NPC.txt raw data string in SMBX64 NPC.txt format. More... | |
| static NPCConfigFile | CreateEmpytNpcTXT () |
| Initialize blank NPC Customizing Config data structure. More... | |
| static PGESTRING | getErrorString (ErrorCodes errCode) |
| Get detailed information from returned error code. More... | |
| static int | smbx64LevelCheckLimits (LevelData &lvl) |
| Validates level file data structure to conformation to SMBX64 Standard. More... | |
| static int | smbx64WorldCheckLimits (WorldData &wld) |
| Validates World map file data structure to conformation to SMBX64 Standard. More... | |
| static PGESTRING | removeQuotes (PGESTRING str) |
| Removes edge dobule quoties characters from a string for example '"Meow"' (without signgle-quotes characters) will be converted into 'Meow' (without signgle-quotes characters) More... | |
Static Public Attributes | |
| static PGESTRING | errorString ="" |
| String which contains info about last happened error. | |
PGE File library class of static functions. Library is buildable in both Qt and STL applications.
File parse error codes.
SMBX64 Standrd specific violation codes.
| Enumerator | |
|---|---|
| SMBX64_FINE |
File data is conforms to the SMBX64 Standard. |
| SMBX64EXC_SECTIONS |
File data structure has exited limit of section entries. |
| SMBX64EXC_BLOCKS |
File data structure has exited limit of block entries. |
| SMBX64EXC_BGOS |
File data structure has exited limit of Background Object entries. |
| SMBX64EXC_NPCS |
File data structure has exited limit of NPC entries. |
| SMBX64EXC_WATERBOXES |
File data structure has exited limit of Water boxes entries. |
| SMBX64EXC_WARPS |
File data structure has exited limit of Warp entries. |
| SMBX64EXC_LAYERS |
File data structure has exited limit of Layer entries. |
| SMBX64EXC_EVENTS |
File data structure has exited limit of Event entries. |
| SMBX64EXC_TILES |
File data structure has exited limit of Tile entries. |
| SMBX64EXC_SCENERIES |
File data structure has exited limit of Scenery entries. |
| SMBX64EXC_PATHS |
File data structure has exited limit of Path entries. |
| SMBX64EXC_LEVELS |
File data structure has exited limit of Level Entrance point entries. |
| SMBX64EXC_MUSICBOXES |
File data structure has exited limit of Music Box entries. |
|
static |
Initialize blank NPC Customizing Config data structure.
|
static |
Initializes blank game save data structure with default preferences.
|
static |
Generates blank initialized level data structure.
|
static |
Initializes Level specific Background Object entry structure with default properties.
|
static |
Initializes Level specific Block entry structure with default properties.
|
static |
|
static |
Initializes Level specific Layer entry structure with default properties.
|
static |
Initializes Level specific NPC entry structure with default properties.
|
static |
Initializes Level specific Physical Environment Zone entry structure with default properties.
|
static |
Initializes Level specific Player spawn point entry structure with default properties.
|
static |
Initializes Level specific Section Settings entry structure with default properties.
|
static |
Initializes Level specific Warp entry structure with default properties.
|
static |
Inirializes Game Save specific playable character state entry.
|
static |
Initializes World map specific Level Entrance point entry structure with default properties.
|
static |
Initializes World map specific Music Box entry structure with default properties.
|
static |
Initializes World map specific Path entry structure with default properties.
|
static |
Initializes World map specific Scenery entry structure with default properties.
|
static |
Initializes World map specific Tile entry structure with default properties.
|
static |
Generates blank initialized World map data structure.
|
static |
Get detailed information from returned error code.
| errCode | Returned error code by file parser |
Parses a level file with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
| filePath | Full path to file which must be opened |
Parses a level file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
| filePath | Full path to file which must be opened |
Parses a world map file with auto-detection of a file type (SMBX1...64 LVL or PGE-WLDX)
| filePath | Full path to file which must be opened |
Parses a world map file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-WLDX)
| filePath | Full path to file which must be opened |
Parses PGE-X level file data.
| RawData | Raw data string in the PGE-X level format |
| filePath | Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible) |
Parses PGE-X Level file header.
| filePath | Full path to PGE-X Level file |
|
static |
Parses PGE-X Game save file from raw data string.
| RawData | raw data string in PGE-X game save format |
| filePath | Path to original file |
Parses PGE-X World map file from raw data.
| RawData | Raw data string in PGE-X World map format |
| filePath | Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible) |
Parsed PGE-X World map file header only.
| filePath | Full path to file which must be opened |
Parses non-SMBX64 meta-data from additional *.meta files there are contains data which impossible to save into SMBX64 LVL file therefore it will be saved into additional *.meta file.
| Raw-data | Full raw file data contents |
|
static |
Parses SMBX64 NPC.txt file.
| file | Full path to NPC.txt |
| IgnoreBad | Don't spawn warning message on errors in the file syntax |
|
static |
Parses SMBX Engine config file raw data string.
| RawData | raw data string in SMBX Engine config file format |
Parses SMBX1...64 level file data.
| RawData | Raw data string in the SMBX1...64 level format |
| filePath | Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible) |
Parses SMBX1...64 level file header and skips other part of a file.
| filePath | Full path to level file |
|
static |
Parses SMBX1...64 Game save file from raw data string.
| RawData | raw data string in SMBX1..64 game save format |
| filePath | Path to original file |
Parses SMBX1...64 World map file from raw data.
| RawData | Raw data string in SMBX1...64 World map format |
| filePath | Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible) |
Parsed SMBX1...64 World map file header only.
| filePath | Full path to file which must be opened |
Removes edge dobule quoties characters from a string for example '"Meow"' (without signgle-quotes characters) will be converted into 'Meow' (without signgle-quotes characters)
| str | Input string with quites characters at begin and end of string |
|
static |
|
static |
Optimizing level data for SMBX64 Standard requirements.
| lvl | Level data structure object |
|
static |
Sorts Background objects by special order priority value Modifying of order priority values allowing to force specific non-foreground BGO's to be rendered foreground.
| lvl | Level data structure object |
|
static |
Sorts blocks array by Y->X positions in the given level data structure. By SMBX64 standard, blocks array must be sorted because it is required for NPC's collision detection algorithm of SMBX Engine.
| lvl | Level data structure object |
|
static |
Generates PGE-X Level file.
| FileData | Level data structure |
|
static |
Generate raw data in PGE-X Game save file from GameSave data structure.
| FileData | Gamesave data structure |
Generates raw data string in PGE-X World map format.
| FileData | World map data structure |
Generates raw data of non-SMBX meta-data file from Meta-data structure.
| metaData | Meta-data structure |
|
static |
|
static |
Generates SMBX Engine specific config file raw data string.
| FileData | SMBX Engine specific config structure |
| file_format | SMBX file format version number (from 0 to 64) |
Generates SMBX1...64 Level file data.
| FileData | Level data structure |
| file_format | SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0] |
Generates raw data string in SMBX1...64 World map format.
| FileData | World map data structure |
| file_format | SMBX file format version number (from 0 to 64) |
1.8.7