Skip to content

GuitarPrometheus::Parser::ScoreImporter

GuitarPrometheus::Parser::ScoreImporter

Dispatch entry point for all score importers. More…

#include <ScoreImporter.h>

Public Functions

Name
ResultimportFile(const std::filesystem::path & file)
Parse a score file from disk, picking the importer by extension.
ResultimportMemory(const std::uint8_t * bytes, std::size_t size, Project::SourceFormat format)
Parse a score from raw in-memory bytes, picking the importer by SourceFormat.

Detailed Description

class GuitarPrometheus::Parser::ScoreImporter;

Dispatch entry point for all score importers.

Inspects the file extension and routes to the correct concrete [IScoreImporter](/api-reference/classes/classguitarprometheus_1_1parser_1_1iscoreimporter/) implementation. Unknown or unsupported extensions return a [Result](/api-reference/classes/structguitarprometheus_1_1parser_1_1result/) with a single error diagnostic.

Recognised extensions (case-insensitive):

  • .musicxml, .xml[MusicXmlParser](/api-reference/classes/classguitarprometheus_1_1parser_1_1musicxmlparser/)
  • .gp[GpFileParser](/api-reference/classes/classguitarprometheus_1_1parser_1_1gpfileparser/) (Guitar Pro 7 / 8 — ZIP + GPIF XML container; phase 17.4)
  • .gpx[GpxFileParser](/api-reference/classes/classguitarprometheus_1_1parser_1_1gpxfileparser/) (Guitar Pro 6 — BitWise container; phase 17.5)

Public Functions Documentation

function importFile

static Result importFile(
const std::filesystem::path & file
)

Parse a score file from disk, picking the importer by extension.

Parameters:

  • file Absolute path to the source file. The extension determines the implementation; unrecognised extensions yield an error Result.

Return: A Result containing either a parsed Score or a list of errors. Warnings are collected separately and are not fatal.

function importMemory

static Result importMemory(
const std::uint8_t * bytes,
std::size_t size,
Project::SourceFormat format
)

Parse a score from raw in-memory bytes, picking the importer by SourceFormat.

Parameters:

  • bytes Raw source bytes (post-decompression).
  • size Number of bytes in bytes.
  • format The source’s logical format — determines the importer.

Return: A Result containing either a parsed Score or a list of errors.

Used by ProjectStore::materializeScore to round-trip an embedded source payload (the project’s getMusicXmlGzip() field after decompression) back into a Score without touching the user’s filesystem.


Updated on 2026-05-29 at 07:39:52 +0000